/*! For license information please see background.mjs.LICENSE.txt */
var e={35625:(e,t)=>{var n=10,r=1e3,i=function(e){return JSON.stringify({ev_type:"batch",list:e})};var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(y){i={error:y}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var c=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],u=function(){return{}};function l(e){return e}function d(e){return"object"==typeof e&&null!==e}var f=Object.prototype;function p(e){return"[object Array]"===f.toString.call(e)}function h(e){return"number"==typeof e}function m(e){return"string"==typeof e}function _(e,t){if(!p(e))return!1;if(0===e.length)return!1;for(var n=0;n<e.length;){if(e[n]===t)return!0;n++}return!1}var g=function(e,t){if(!p(e))return e;var n=e.indexOf(t);if(n>=0){var r=e.slice();return r.splice(n,1),r}return e};function v(e){try{return m(e)?e:JSON.stringify(e)}catch(t){return"[FAILED_TO_STRINGIFY]:"+String(t)}}var y=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},b=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},w=function(e){return Math.random()<Number(e)},k=function(e,t){return e<Number(t)},E=function(e){return function(t){for(var n=t,r=0;r<e.length&&n;r++)try{n=e[r](n)}catch(i){y(i)}return n}};function S(){var e=function(){for(var e=new Array(16),t=0,n=0;n<16;n++)3&n||(t=4294967296*Math.random()),e[n]=t>>>((3&n)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);var r=0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}(e)}function T(e){var t,n,r=e.builder,i=e.createSender,o=e.createDefaultConfig,u=e.createConfigManager,l=e.userConfigNormalizer,f=e.initConfigNormalizer,p=e.validateInitConfig,h={};c.forEach((function(e){return h[e]=[]}));var m=!1,v=!1,y=!1,w=[],k=[],S=function(){var e=!1,t={},n=function(e){e.length&&e.forEach((function(e){try{e()}catch(Mu){}})),e.length=0},r=function(e){t[e]&&t[e].forEach((function(e){n(e[1])})),t[e]=void 0};return{set:function(r,i,o){t[r]?t[r].push([i,o]):t[r]=[[i,o]],e&&n(o)},has:function(e){return!!t[e]},remove:r,removeByEvType:function(e){Object.keys(t).forEach((function(r){t[r]&&t[r].forEach((function(t){t[0]===e&&n(t[1])}))}))},clear:function(){e=!0,Object.keys(t).forEach((function(e){r(e)}))}}}(),T={getBuilder:function(){return r},getSender:function(){return t},getPreStartQueue:function(){return w},init:function(e){if(m)b("already inited");else{if(!(e&&d(e)&&p(e)))throw new Error("invalid InitConfig, init failed");var r=o(e);if(!r)throw new Error("defaultConfig missing");var s=f(e);if((n=u(r)).setConfig(s),n.onChange((function(){I("config")})),!(t=i(n.getConfig())))throw new Error("sender missing");m=!0,I("init",!0)}},set:function(e){m&&e&&d(e)&&(I("beforeConfig",!1,e),null==n||n.setConfig(e))},config:function(e){if(m)return e&&d(e)&&(I("beforeConfig",!1,e),null==n||n.setConfig(l(e))),null==n?void 0:n.getConfig()},provide:function(e,t){_(k,e)?b("cannot provide "+e+", reserved"):(T[e]=t,I("provide",!1,e))},start:function(){var e=this;m&&(v||null==n||n.onReady((function(){v=!0,I("start",!0),w.forEach((function(t){return e.build(t)})),w.length=0})))},report:function(e){if(e){var t=E(h.beforeReport)(e);if(t){var n=E(h.report)(t);n&&(v?this.build(n):w.push(n))}}},build:function(e){if(v){var t=E(h.beforeBuild)(e);if(t){var n=r.build(t);if(n){var i=E(h.build)(n);i&&this.send(i)}}}},send:function(e){if(v){var n=E(h.beforeSend)(e);n&&(t.send(n),I("send",!1,n))}},destroy:function(){S.clear(),y=!0,w.length=0,I("beforeDestroy",!0)},on:function(e,t){if("init"===e&&m||"start"===e&&v||"beforeDestroy"===e&&y)try{t()}catch(n){}else h[e]&&h[e].push(t)},off:function(e,t){h[e]&&(h[e]=g(h[e],t))},destroyAgent:S};return k=Object.keys(T),T;function I(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];h[e].forEach((function(e){try{e.apply(void 0,a([],s(n),!1))}catch(t){}})),t&&(h[e].length=0)}}var I=function(e){var t=function(){var e={},t={},n={set:function(r,i){return e[r]=i,t[r]=v(i),n},merge:function(r){return e=o(o({},e),r),Object.keys(r).forEach((function(e){t[e]=v(r[e])})),n},delete:function(r){return delete e[r],delete t[r],n},clear:function(){return e={},t={},n},get:function(e){return t[e]},toString:function(){return o({},t)}};return n}();e.provide("context",t),e.on("report",(function(e){return e.extra||(e.extra={}),e.extra.context=t.toString(),e}))};var x=function(){return Date.now()};var O=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar}(function(){if("object"==typeof window&&d(window))return window}());n&&(n.errors||(n.errors=[]),n.errors.push(e))},N="custom",A=function(e){e.provide("sendEvent",(function(t){var n=function(e){if(e&&d(e)&&e.name&&m(e.name)){var t={name:e.name,type:"event"};if("metrics"in e&&d(e.metrics)){var n=e.metrics,r={};for(var i in n)h(n[i])&&(r[i]=n[i]);t.metrics=r}if("categories"in e&&d(e.categories)){var o=e.categories,s={};for(var i in o)s[i]=v(o[i]);t.categories=s}return t}}(t);n&&e.report({ev_type:N,payload:n,extra:{timestamp:x()}})})),e.provide("sendLog",(function(t){var n=function(e){if(e&&d(e)&&e.content&&m(e.content)){var t={content:v(e.content),type:"log",level:"info"};if("level"in e&&(t.level=e.level),"extra"in e&&d(e.extra)){var n=e.extra,r={},i={};for(var o in n)h(n[o])?r[o]=n[o]:i[o]=v(n[o]);t.metrics=r,t.categories=i}return t}}(t);n&&e.report({ev_type:N,payload:n,extra:{timestamp:x()}})}))},R=function(e,t){var n=e.common||{};return n.sample_rate=t,e.common=n,e},L=function(e,t,n,r,i){return e?function(e){return function(){return e}}(i(r,t)):function(){return n(t)}},C=function(e,t,n,r){var i=function(e,t,n){for(var r,i=s(t.split(".")),o=i[0],a=i.slice(1);e&&a.length>0;)e=e[o],o=(r=s(a))[0],a=r.slice(1);if(e)return n(e,o)}(e,t,(function(e,t){return e[t]}));if(void 0===i)return!1;var o=function(e){return"boolean"==typeof e}(i)?"bool":h(i)?"number":"string";return function(e,t,n){switch(n){case"eq":return _(t,e);case"neq":return!_(t,e);case"gt":return e>t[0];case"gte":return e>=t[0];case"lt":return e<t[0];case"lte":return e<=t[0];case"regex":return Boolean(e.match(new RegExp(t.join("|"))));case"not_regex":return!e.match(new RegExp(t.join("|")));default:return!1}}(i,function(e,t){return e.map((function(e){switch(t){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}}))}(r,o),n)},P=function(e,t){try{return"rule"===t.type?C(e,t.field,t.op,t.values):"and"===t.type?t.children.every((function(t){return P(e,t)})):t.children.some((function(t){return P(e,t)}))}catch(n){return O(n),!1}},M=function(e,t,n,r,i){if(!t)return l;var o=t.sample_rate,s=t.include_users,a=t.sample_granularity,c=t.rules,u=t.r,d=void 0===u?Math.random():u;if(_(s,e))return function(e){return R(e,1)};var f="session"===a,p=L(f,o,n,d,r),h=function(e,t,n,r,i,o){var s={};return Object.keys(e).forEach((function(a){var c=e[a],u=c.enable,l=c.sample_rate,d=c.conditional_sample_rules;u?(s[a]={enable:u,sample_rate:l,effectiveSampleRate:l*n,hit:L(t,l,r,i,o)},d&&(s[a].conditional_hit_rules=d.map((function(e){var s=e.sample_rate,a=e.filter;return{sample_rate:s,hit:L(t,s,r,i,o),effectiveSampleRate:s*n,filter:a}})))):s[a]={enable:u,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}})),s}(c,f,o,n,d,r);return function(e){var t;if(!p())return f&&i[0](),!1;if(!(e.ev_type in h))return R(e,o);if(!h[e.ev_type].enable)return f&&i[1](e.ev_type),!1;if(null===(t=e.common)||void 0===t?void 0:t.sample_rate)return e;var n=h[e.ev_type],r=n.conditional_hit_rules;if(r)for(var s=0;s<r.length;s++)if(P(e,r[s].filter))return!!r[s].hit()&&R(e,r[s].effectiveSampleRate);return n.hit()?R(e,n.effectiveSampleRate):((!r||!r.length)&&f&&i[1](e.ev_type),!1)}},D={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:o(o({},e.extra||{}),e.overrides||{})}}},j=function(e){var t,n=e,r={},i=u,s=u;return{getConfig:function(){return n},setConfig:function(a){var c;return r=o(o({},r),a||{}),(c=o(o({},e),r)).sample=B(e.sample,r.sample),n=c,s(),t||(t=a,i()),n},onChange:function(e){s=e},onReady:function(e){i=e,t&&i()}}};function B(e,t){if(!e||!t)return e||t;var n=o(o({},e),t);return n.include_users=a(a([],s(e.include_users||[]),!1),s(t.include_users||[]),!1),n.rules=a(a([],s(Object.keys(e.rules||{})),!1),s(Object.keys(t.rules||{})),!1).reduce((function(n,r){var i,c;return r in n||(r in(e.rules||{})&&r in(t.rules||{})?(n[r]=o(o({},e.rules[r]),t.rules[r]),n[r].conditional_sample_rules=a(a([],s(e.rules[r].conditional_sample_rules||[]),!1),s(t.rules[r].conditional_sample_rules||[]),!1)):n[r]=(null===(i=e.rules)||void 0===i?void 0:i[r])||(null===(c=t.rules)||void 0===c?void 0:c[r])),n}),{}),n}var F="mon-va.byteoversea.com",U=F,G="1.4.5",q="SDK_BASE",W="/monitor_web/settings/browser-settings",z="/monitor_browser/collect/batch/",V={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}};function J(e){return o({},e)}function H(e){return d(e)&&"bid"in e&&"transport"in e}function K(e){return o({},e)}var $=function(e,t){var n={url:"",protocol:"",domain:"",path:"",query:"",timestamp:Date.now(),sdk_version:t.version||G,sdk_name:t.name||q};return o(o({},e),{extra:o(o({},n),e.extra||{})})},Y=function(e){e.on("report",(function(t){return $(t,e.config())}))},X=function(e,t){var n={};return n.bid=t.bid,n.pid=t.pid,n.view_id=t.viewId,n.user_id=t.userId,n.device_id=t.deviceId,n.session_id=t.sessionId,n.release=t.release,n.env=t.env,o(o({},e),{extra:o(o({},n),e.extra||{})})},Q=function(e){e.on("beforeBuild",(function(t){return X(t,e.config())}))};function Z(e){return function(e){var t,o=e.transport,s=e.endpoint,a=e.size,c=void 0===a?n:a,u=e.wait,l=void 0===u?r:u,d=[],f=0;function p(){if(d.length){var e=this.getBatchData();o.post({url:s,data:e,fail:function(n){t&&t(n,e)}}),d=[]}}return{getSize:function(){return c},getWait:function(){return l},setSize:function(e){c=e},setWait:function(e){l=e},getEndpoint:function(){return s},setEndpoint:function(e){s=e},send:function(e){d.push(e),d.length>=c&&p.call(this),clearTimeout(f),f=setTimeout(p.bind(this),l)},flush:function(){clearTimeout(f),p.call(this)},getBatchData:function(){return d.length?i(d):""},clear:function(){clearTimeout(f),d=[]},fail:function(e){t=e}}}(e)}var ee=function(e,t){return void 0===t&&(t=z),(e&&e.indexOf("//")>=0?"":"https://")+e+t},te=function(){return S()},ne=function(){return S()},re=function(e){return e+"_"+Date.now()},ie=function(){return S()},oe=function(e){return{bid:"",pid:"",viewId:re("_"),userId:te(),deviceId:ne(),sessionId:ie(),domain:F,release:"",env:"production",sample:V,plugins:{},transport:{get:u,post:u}}},se=function(e){var t=void 0===e?{}:e,n=t.createSender,r=void 0===n?function(e){return Z({size:20,endpoint:ee(e.domain),transport:e.transport})}:n,i=t.builder,o=void 0===i?D:i,s=t.createDefaultConfig,a=T({validateInitConfig:H,initConfigNormalizer:J,userConfigNormalizer:K,createSender:r,builder:o,createDefaultConfig:void 0===s?oe:s,createConfigManager:j});return I(a),Q(a),Y(a),function(e,t){e.on("init",(function(){var n=[],r=function(r){r.forEach((function(r){var i=r.name;_(n,i)||(n.push(i),r.setup(e),t&&t(i,r.setup),e.destroyAgent.set(i,i,[function(){n=g(n,i),r.tearDown&&r.tearDown()}]))}))};e.provide("applyIntegrations",r);var i=e.config();i&&i.integrations&&r(i.integrations)}))}(a),a},ae=function(e){void 0===e&&(e={});var t=se(e);return function(e){e.on("start",(function(){var t=e.config(),n=t.userId,r=t.sample,i=M(n,r,w,k,[function(){e.destroy()},function(t){e.destroyAgent.removeByEvType(t)}]);e.on("build",i)}))}(t),A(t),t},ce=ae();t.Ay=ce},58311:(e,t)=>{var n=10,r=1e3,i=function(e){return JSON.stringify({ev_type:"batch",list:e})};var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(y){i={error:y}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var c=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],u=function(){return{}};function l(e){return e}function d(e){return"object"==typeof e&&null!==e}var f=Object.prototype;function p(e){return"[object Array]"===f.toString.call(e)}function h(e){return"number"==typeof e}function m(e){return"string"==typeof e}function _(e,t){if(!p(e))return!1;if(0===e.length)return!1;for(var n=0;n<e.length;){if(e[n]===t)return!0;n++}return!1}var g=function(e,t){if(!p(e))return e;var n=e.indexOf(t);if(n>=0){var r=e.slice();return r.splice(n,1),r}return e};function v(e){try{return m(e)?e:JSON.stringify(e)}catch(t){return"[FAILED_TO_STRINGIFY]:"+String(t)}}var y=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},b=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},w=function(e){return Math.random()<Number(e)},k=function(e,t){return e<Number(t)},E=function(e){return function(t){for(var n=t,r=0;r<e.length&&n;r++)try{n=e[r](n)}catch(i){y(i)}return n}};function S(){var e=function(){for(var e=new Array(16),t=0,n=0;n<16;n++)3&n||(t=4294967296*Math.random()),e[n]=t>>>((3&n)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);var r=0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}(e)}function T(e){var t,n,r=e.builder,i=e.createSender,o=e.createDefaultConfig,u=e.createConfigManager,l=e.userConfigNormalizer,f=e.initConfigNormalizer,p=e.validateInitConfig,h={};c.forEach((function(e){return h[e]=[]}));var m=!1,v=!1,y=!1,w=[],k=[],S=function(){var e=!1,t={},n=function(e){e.length&&e.forEach((function(e){try{e()}catch(Mu){}})),e.length=0},r=function(e){t[e]&&t[e].forEach((function(e){n(e[1])})),t[e]=void 0};return{set:function(r,i,o){t[r]?t[r].push([i,o]):t[r]=[[i,o]],e&&n(o)},has:function(e){return!!t[e]},remove:r,removeByEvType:function(e){Object.keys(t).forEach((function(r){t[r]&&t[r].forEach((function(t){t[0]===e&&n(t[1])}))}))},clear:function(){e=!0,Object.keys(t).forEach((function(e){r(e)}))}}}(),T={getBuilder:function(){return r},getSender:function(){return t},getPreStartQueue:function(){return w},init:function(e){if(m)b("already inited");else{if(!(e&&d(e)&&p(e)))throw new Error("invalid InitConfig, init failed");var r=o(e);if(!r)throw new Error("defaultConfig missing");var s=f(e);if((n=u(r)).setConfig(s),n.onChange((function(){I("config")})),!(t=i(n.getConfig())))throw new Error("sender missing");m=!0,I("init",!0)}},set:function(e){m&&e&&d(e)&&(I("beforeConfig",!1,e),null==n||n.setConfig(e))},config:function(e){if(m)return e&&d(e)&&(I("beforeConfig",!1,e),null==n||n.setConfig(l(e))),null==n?void 0:n.getConfig()},provide:function(e,t){_(k,e)?b("cannot provide "+e+", reserved"):(T[e]=t,I("provide",!1,e))},start:function(){var e=this;m&&(v||null==n||n.onReady((function(){v=!0,I("start",!0),w.forEach((function(t){return e.build(t)})),w.length=0})))},report:function(e){if(e){var t=E(h.beforeReport)(e);if(t){var n=E(h.report)(t);n&&(v?this.build(n):w.push(n))}}},build:function(e){if(v){var t=E(h.beforeBuild)(e);if(t){var n=r.build(t);if(n){var i=E(h.build)(n);i&&this.send(i)}}}},send:function(e){if(v){var n=E(h.beforeSend)(e);n&&(t.send(n),I("send",!1,n))}},destroy:function(){S.clear(),y=!0,w.length=0,I("beforeDestroy",!0)},on:function(e,t){if("init"===e&&m||"start"===e&&v||"beforeDestroy"===e&&y)try{t()}catch(n){}else h[e]&&h[e].push(t)},off:function(e,t){h[e]&&(h[e]=g(h[e],t))},destroyAgent:S};return k=Object.keys(T),T;function I(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];h[e].forEach((function(e){try{e.apply(void 0,a([],s(n),!1))}catch(t){}})),t&&(h[e].length=0)}}var I=function(e){var t=function(){var e={},t={},n={set:function(r,i){return e[r]=i,t[r]=v(i),n},merge:function(r){return e=o(o({},e),r),Object.keys(r).forEach((function(e){t[e]=v(r[e])})),n},delete:function(r){return delete e[r],delete t[r],n},clear:function(){return e={},t={},n},get:function(e){return t[e]},toString:function(){return o({},t)}};return n}();e.provide("context",t),e.on("report",(function(e){return e.extra||(e.extra={}),e.extra.context=t.toString(),e}))};var x=function(){return Date.now()};var O=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar}(function(){if("object"==typeof window&&d(window))return window}());n&&(n.errors||(n.errors=[]),n.errors.push(e))},N="custom",A=function(e){e.provide("sendEvent",(function(t){var n=function(e){if(e&&d(e)&&e.name&&m(e.name)){var t={name:e.name,type:"event"};if("metrics"in e&&d(e.metrics)){var n=e.metrics,r={};for(var i in n)h(n[i])&&(r[i]=n[i]);t.metrics=r}if("categories"in e&&d(e.categories)){var o=e.categories,s={};for(var i in o)s[i]=v(o[i]);t.categories=s}return t}}(t);n&&e.report({ev_type:N,payload:n,extra:{timestamp:x()}})})),e.provide("sendLog",(function(t){var n=function(e){if(e&&d(e)&&e.content&&m(e.content)){var t={content:v(e.content),type:"log",level:"info"};if("level"in e&&(t.level=e.level),"extra"in e&&d(e.extra)){var n=e.extra,r={},i={};for(var o in n)h(n[o])?r[o]=n[o]:i[o]=v(n[o]);t.metrics=r,t.categories=i}return t}}(t);n&&e.report({ev_type:N,payload:n,extra:{timestamp:x()}})}))},R=function(e,t){var n=e.common||{};return n.sample_rate=t,e.common=n,e},L=function(e,t,n,r,i){return e?function(e){return function(){return e}}(i(r,t)):function(){return n(t)}},C=function(e,t,n,r){var i=function(e,t,n){for(var r,i=s(t.split(".")),o=i[0],a=i.slice(1);e&&a.length>0;)e=e[o],o=(r=s(a))[0],a=r.slice(1);if(e)return n(e,o)}(e,t,(function(e,t){return e[t]}));if(void 0===i)return!1;var o=function(e){return"boolean"==typeof e}(i)?"bool":h(i)?"number":"string";return function(e,t,n){switch(n){case"eq":return _(t,e);case"neq":return!_(t,e);case"gt":return e>t[0];case"gte":return e>=t[0];case"lt":return e<t[0];case"lte":return e<=t[0];case"regex":return Boolean(e.match(new RegExp(t.join("|"))));case"not_regex":return!e.match(new RegExp(t.join("|")));default:return!1}}(i,function(e,t){return e.map((function(e){switch(t){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}}))}(r,o),n)},P=function(e,t){try{return"rule"===t.type?C(e,t.field,t.op,t.values):"and"===t.type?t.children.every((function(t){return P(e,t)})):t.children.some((function(t){return P(e,t)}))}catch(n){return O(n),!1}},M=function(e,t,n,r,i){if(!t)return l;var o=t.sample_rate,s=t.include_users,a=t.sample_granularity,c=t.rules,u=t.r,d=void 0===u?Math.random():u;if(_(s,e))return function(e){return R(e,1)};var f="session"===a,p=L(f,o,n,d,r),h=function(e,t,n,r,i,o){var s={};return Object.keys(e).forEach((function(a){var c=e[a],u=c.enable,l=c.sample_rate,d=c.conditional_sample_rules;u?(s[a]={enable:u,sample_rate:l,effectiveSampleRate:l*n,hit:L(t,l,r,i,o)},d&&(s[a].conditional_hit_rules=d.map((function(e){var s=e.sample_rate,a=e.filter;return{sample_rate:s,hit:L(t,s,r,i,o),effectiveSampleRate:s*n,filter:a}})))):s[a]={enable:u,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}})),s}(c,f,o,n,d,r);return function(e){var t;if(!p())return f&&i[0](),!1;if(!(e.ev_type in h))return R(e,o);if(!h[e.ev_type].enable)return f&&i[1](e.ev_type),!1;if(null===(t=e.common)||void 0===t?void 0:t.sample_rate)return e;var n=h[e.ev_type],r=n.conditional_hit_rules;if(r)for(var s=0;s<r.length;s++)if(P(e,r[s].filter))return!!r[s].hit()&&R(e,r[s].effectiveSampleRate);return n.hit()?R(e,n.effectiveSampleRate):((!r||!r.length)&&f&&i[1](e.ev_type),!1)}},D={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:o(o({},e.extra||{}),e.overrides||{})}}},j=function(e){var t,n=e,r={},i=u,s=u;return{getConfig:function(){return n},setConfig:function(a){var c;return r=o(o({},r),a||{}),(c=o(o({},e),r)).sample=B(e.sample,r.sample),n=c,s(),t||(t=a,i()),n},onChange:function(e){s=e},onReady:function(e){i=e,t&&i()}}};function B(e,t){if(!e||!t)return e||t;var n=o(o({},e),t);return n.include_users=a(a([],s(e.include_users||[]),!1),s(t.include_users||[]),!1),n.rules=a(a([],s(Object.keys(e.rules||{})),!1),s(Object.keys(t.rules||{})),!1).reduce((function(n,r){var i,c;return r in n||(r in(e.rules||{})&&r in(t.rules||{})?(n[r]=o(o({},e.rules[r]),t.rules[r]),n[r].conditional_sample_rules=a(a([],s(e.rules[r].conditional_sample_rules||[]),!1),s(t.rules[r].conditional_sample_rules||[]),!1)):n[r]=(null===(i=e.rules)||void 0===i?void 0:i[r])||(null===(c=t.rules)||void 0===c?void 0:c[r])),n}),{}),n}var F="mon-va.byteoversea.com",U=F,G="1.4.5",q="SDK_BASE",W="/monitor_web/settings/browser-settings",z="/monitor_browser/collect/batch/",V={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}};function J(e){return o({},e)}function H(e){return d(e)&&"bid"in e&&"transport"in e}function K(e){return o({},e)}var $=function(e,t){var n={url:"",protocol:"",domain:"",path:"",query:"",timestamp:Date.now(),sdk_version:t.version||G,sdk_name:t.name||q};return o(o({},e),{extra:o(o({},n),e.extra||{})})},Y=function(e){e.on("report",(function(t){return $(t,e.config())}))},X=function(e,t){var n={};return n.bid=t.bid,n.pid=t.pid,n.view_id=t.viewId,n.user_id=t.userId,n.device_id=t.deviceId,n.session_id=t.sessionId,n.release=t.release,n.env=t.env,o(o({},e),{extra:o(o({},n),e.extra||{})})},Q=function(e){e.on("beforeBuild",(function(t){return X(t,e.config())}))};function Z(e){return function(e){var t,o=e.transport,s=e.endpoint,a=e.size,c=void 0===a?n:a,u=e.wait,l=void 0===u?r:u,d=[],f=0;function p(){if(d.length){var e=this.getBatchData();o.post({url:s,data:e,fail:function(n){t&&t(n,e)}}),d=[]}}return{getSize:function(){return c},getWait:function(){return l},setSize:function(e){c=e},setWait:function(e){l=e},getEndpoint:function(){return s},setEndpoint:function(e){s=e},send:function(e){d.push(e),d.length>=c&&p.call(this),clearTimeout(f),f=setTimeout(p.bind(this),l)},flush:function(){clearTimeout(f),p.call(this)},getBatchData:function(){return d.length?i(d):""},clear:function(){clearTimeout(f),d=[]},fail:function(e){t=e}}}(e)}var ee=function(e,t){return void 0===t&&(t=z),(e&&e.indexOf("//")>=0?"":"https://")+e+t},te=function(){return S()},ne=function(){return S()},re=function(e){return e+"_"+Date.now()},ie=function(){return S()},oe=function(e){return{bid:"",pid:"",viewId:re("_"),userId:te(),deviceId:ne(),sessionId:ie(),domain:F,release:"",env:"production",sample:V,plugins:{},transport:{get:u,post:u}}},se=function(e){var t=void 0===e?{}:e,n=t.createSender,r=void 0===n?function(e){return Z({size:20,endpoint:ee(e.domain),transport:e.transport})}:n,i=t.builder,o=void 0===i?D:i,s=t.createDefaultConfig,a=T({validateInitConfig:H,initConfigNormalizer:J,userConfigNormalizer:K,createSender:r,builder:o,createDefaultConfig:void 0===s?oe:s,createConfigManager:j});return I(a),Q(a),Y(a),function(e,t){e.on("init",(function(){var n=[],r=function(r){r.forEach((function(r){var i=r.name;_(n,i)||(n.push(i),r.setup(e),t&&t(i,r.setup),e.destroyAgent.set(i,i,[function(){n=g(n,i),r.tearDown&&r.tearDown()}]))}))};e.provide("applyIntegrations",r);var i=e.config();i&&i.integrations&&r(i.integrations)}))}(a),a},ae=function(e){void 0===e&&(e={});var t=se(e);return function(e){e.on("start",(function(){var t=e.config(),n=t.userId,r=t.sample,i=M(n,r,w,k,[function(){e.destroy()},function(t){e.destroyAgent.removeByEvType(t)}]);e.on("build",i)}))}(t),A(t),t},ce=ae();t.Ay=ce},4898:(e,t)=>{var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(A){i={error:A}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function i(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var o=10,s=1e3,a=function(e){return JSON.stringify({ev_type:"batch",list:e})};var c=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],u=function(){return{}};function l(e){return e}function d(e){return"object"==typeof e&&null!==e}var f=Object.prototype;function p(e){if(d(e)){if("function"==typeof Object.getPrototypeOf){var t=Object.getPrototypeOf(e);return t===f||null===t}return"[object Object]"===f.toString.call(e)}return!1}function h(e){return"[object Array]"===f.toString.call(e)}function m(e){return"function"==typeof e}function _(e){return"number"==typeof e}function g(e){return"string"==typeof e}function v(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function y(e,t){var r=n({},e);for(var i in t)v(t,i)&&void 0!==t[i]&&(d(t[i])&&p(t[i])?r[i]=y(d(e[i])?e[i]:{},t[i]):h(t[i])&&h(e[i])?r[i]=b(e[i],t[i]):r[i]=t[i]);return r}function b(e,t){var n=h(e)?e:[],r=h(t)?t:[];return Array.prototype.concat.call(n,r).map((function(e){return e instanceof RegExp?e:d(e)&&p(e)?y({},e):h(e)?b([],e):e}))}function w(e,t){if(!h(e))return!1;if(0===e.length)return!1;for(var n=0;n<e.length;){if(e[n]===t)return!0;n++}return!1}var k=function(e,t){if(!h(e))return e;var n=e.indexOf(t);if(n>=0){var r=e.slice();return r.splice(n,1),r}return e},E=function(e,t,n){for(var i,o=r(t.split(".")),s=o[0],a=o.slice(1);e&&a.length>0;)e=e[s],s=(i=r(a))[0],a=i.slice(1);if(e)return n(e,s)},S=function(e){return e.replace(/([a-z])([A-Z])/g,(function(e,t,n){return t+"-"+n.toLowerCase()}))};function T(e){return h(e)&&e.length?function(e){for(var t=[],n=e.length,r=0;r<n;r++){var i=e[r];g(i)?t.push(i.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):i&&i.source&&t.push(i.source)}return new RegExp(t.join("|"),"i")}(e):null}var I=function(e,t){var n=T(e||[]);return!!n&&n.test(t)};function x(e){try{return g(e)?e:JSON.stringify(e)}catch(t){return"[FAILED_TO_STRINGIFY]:"+String(t)}}var O=function(e,t,n,o){return void 0===o&&(o=!0),function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(!e)return u;var c=e[t],l=n.apply(void 0,i([c],r(s),!1)),d=l;return m(d)&&o&&(d=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return l.apply(this,e)}catch(nr){return m(c)&&c.apply(this,e)}}),e[t]=d,function(n){n||(d===e[t]?e[t]=c:l=c)}}},N=function(e,t,n){return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];if(!e)return u;var a=e[t],c=n.apply(void 0,i([a],r(o),!1)),l=c;return m(l)&&(l=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.apply(this,e)}),e[t]=l,function(){l===e[t]?e[t]=a:c=a}}},A=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},R=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},L=function(e){return Math.random()<Number(e)},C=function(e,t){return e<Number(t)},P=function(e){return function(t){for(var n=t,r=0;r<e.length&&n;r++)try{n=e[r](n)}catch(i){A(i)}return n}};function M(){var e=function(){for(var e=new Array(16),t=0,n=0;n<16;n++)3&n||(t=4294967296*Math.random()),e[n]=t>>>((3&n)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);var r=0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}(e)}var D=function(e,t){var n=[];try{n=t.reduce((function(t,n){try{var r=n(e);"function"==typeof r&&t.push(r)}catch(nr){}return t}),[])}catch(nr){}return function(e){return D(e,n)}},j=function(e){void 0===e&&(e=3e5);var t,n=[],r=[],i=!1,o=function(e,t,n){var r=0;return-1===n?u:function(){if(e())return r&&clearTimeout(r),void(r=0);0===r&&(r=setTimeout(t,n))}}((function(){return!!n.length}),(function(){i=!0,t&&t[0](),r.forEach((function(e){return e()})),r.length=0,t=void 0}),e),s=function(e){n=k(n,e),!i&&o()};return{next:function(e){return D(e,n)},complete:function(e){r.push(e)},attach:function(e,n){t=[e,n]},subscribe:function(e){if(i)throw new Error("Observer is closed");return n.push(e),t&&t[1]&&t[1](e),o(),function(){return s(e)}},unsubscribe:s}},B=function(e,t,n){var r=j(n);try{e(r.next,r.attach),t&&r.complete(t)}catch(nr){}return[r.subscribe,r.unsubscribe]},F=function(e,t){var n=r(e,1)[0];return function(e,r){var i=n((function(n){var r,i=(r=t,function(e){for(var t=!0,n=0;n<r.length&&t;n++)try{t=r[n](e)}catch(i){A(i)}return t})(n);return i?e(n):u}));r((function(){i()}))}};var U=function(e,t,n,r){return e.destroyAgent.set(t,n,r)};function G(e){var t,n,o=e.builder,s=e.createSender,a=e.createDefaultConfig,u=e.createConfigManager,l=e.userConfigNormalizer,f=e.initConfigNormalizer,p=e.validateInitConfig,h={};c.forEach((function(e){return h[e]=[]}));var m=!1,_=!1,g=!1,v=[],y=[],b=function(){var e=!1,t={},n=function(e){e.length&&e.forEach((function(e){try{e()}catch(nr){}})),e.length=0},r=function(e){t[e]&&t[e].forEach((function(e){n(e[1])})),t[e]=void 0};return{set:function(r,i,o){t[r]?t[r].push([i,o]):t[r]=[[i,o]],e&&n(o)},has:function(e){return!!t[e]},remove:r,removeByEvType:function(e){Object.keys(t).forEach((function(r){t[r]&&t[r].forEach((function(t){t[0]===e&&n(t[1])}))}))},clear:function(){e=!0,Object.keys(t).forEach((function(e){r(e)}))}}}(),E={getBuilder:function(){return o},getSender:function(){return t},getPreStartQueue:function(){return v},init:function(e){if(m)R("already inited");else{if(!(e&&d(e)&&p(e)))throw new Error("invalid InitConfig, init failed");var r=a(e);if(!r)throw new Error("defaultConfig missing");var i=f(e);if((n=u(r)).setConfig(i),n.onChange((function(){S("config")})),!(t=s(n.getConfig())))throw new Error("sender missing");m=!0,S("init",!0)}},set:function(e){m&&e&&d(e)&&(S("beforeConfig",!1,e),null==n||n.setConfig(e))},config:function(e){if(m)return e&&d(e)&&(S("beforeConfig",!1,e),null==n||n.setConfig(l(e))),null==n?void 0:n.getConfig()},provide:function(e,t){w(y,e)?R("cannot provide "+e+", reserved"):(E[e]=t,S("provide",!1,e))},start:function(){var e=this;m&&(_||null==n||n.onReady((function(){_=!0,S("start",!0),v.forEach((function(t){return e.build(t)})),v.length=0})))},report:function(e){if(e){var t=P(h.beforeReport)(e);if(t){var n=P(h.report)(t);n&&(_?this.build(n):v.push(n))}}},build:function(e){if(_){var t=P(h.beforeBuild)(e);if(t){var n=o.build(t);if(n){var r=P(h.build)(n);r&&this.send(r)}}}},send:function(e){if(_){var n=P(h.beforeSend)(e);n&&(t.send(n),S("send",!1,n))}},destroy:function(){b.clear(),g=!0,v.length=0,S("beforeDestroy",!0)},on:function(e,t){if("init"===e&&m||"start"===e&&_||"beforeDestroy"===e&&g)try{t()}catch(n){}else h[e]&&h[e].push(t)},off:function(e,t){h[e]&&(h[e]=k(h[e],t))},destroyAgent:b};return y=Object.keys(E),E;function S(e,t){void 0===t&&(t=!1);for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];h[e].forEach((function(e){try{e.apply(void 0,i([],r(n),!1))}catch(t){}})),t&&(h[e].length=0)}}var q=function(e){var t=function(){var e={},t={},r={set:function(n,i){return e[n]=i,t[n]=x(i),r},merge:function(i){return e=n(n({},e),i),Object.keys(i).forEach((function(e){t[e]=x(i[e])})),r},delete:function(n){return delete e[n],delete t[n],r},clear:function(){return e={},t={},r},get:function(e){return t[e]},toString:function(){return n({},t)}};return r}();e.provide("context",t),e.on("report",(function(e){return e.extra||(e.extra={}),e.extra.context=t.toString(),e}))},W=function(e,t,n){var o={},s=function(){for(var n,a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];var u=a[0];if(u){var l=u.split(".")[0];if(!(l in s)){var d=o[l]||[],f=null!==(n=null==t?void 0:t(e))&&void 0!==n?n:{};return d.push(i([f],r(a),!1)),void(o[l]=d)}return function(e,t,n){return E(e,t,(function(e,t){if(e&&t in e&&m(e[t]))try{return e[t].apply(e,n)}catch(r){return}}))}(s,u,[].slice.call(a,1))}};for(var a in O(e,"provide",(function(t){return function(n,r){s[n]=r,t.call(e,n,r)}}))(),e)Object.prototype.hasOwnProperty.call(e,a)&&(s[a]=e[a]);return e.on("provide",(function(t){o[t]&&(o[t].forEach((function(t){var i=r(t),o=i[0],s=i.slice(1);null==n||n(e,o,s)})),o[t]=null)})),s};function z(e,t){return e.initSubject(t)}function V(e,t,n){var i=r(t,2),o=i[0],s=i[1],a=e.privateSubject||{};return a[o]||(a[o]=B(s,(function(){a[o]=void 0}),n)),a[o]}var J=function(){return Date.now()};function H(){if("object"==typeof window&&d(window))return window}function K(){if("object"==typeof document&&d(document))return document}function $(){return H()&&window.location}function Y(){return H()&&window.history}function X(){if(H()&&d(window.performance))return window.performance}function Q(){if("function"==typeof XMLHttpRequest&&m(XMLHttpRequest))return XMLHttpRequest}function Z(){if(H()&&m(window.MutationObserver))return window.MutationObserver}function ee(){if(H()&&m(window.PerformanceObserver))return window.PerformanceObserver}function te(){var e=function(){if(H()&&"navigator"in window)return window.navigator}();if(e)return e.connection||e.mozConnection||e.webkitConnection}function ne(){if(!document)return null;if(document.currentScript)return document.currentScript;try{throw new Error}catch(u){var e=0,t=/at\s+(.*)\s+\((.*):(\d*):(\d*)\)/i.exec(u.stack),n=t&&t[2]||!1,r=t&&t[3]||0,i=document.location.href.replace(document.location.hash,""),o="",s=document.getElementsByTagName("script");if(n===i){var a=document.documentElement.outerHTML,c=new RegExp("(?:[^\\n]+?\\n){0,"+(r-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i");o=a.replace(c,"$1").trim()}for(;e<s.length;e++){if("interactive"===s[e].readyState)return s[e];if(s[e].src===n)return s[e];if(n===i&&s[e].innerHTML&&s[e].innerHTML.trim()===o)return s[e]}return null}}function re(e){var t=K();if(!t||!e)return"";var n=t.createElement("a");return n.href=e,n.href}function ie(e){var t=K();if(!t||!e)return{url:e,protocol:"",domain:"",query:"",path:"",hash:""};var n=t.createElement("a");n.href=e;var r=n.pathname||"/";return"/"!==r[0]&&(r="/"+r),{url:n.href,protocol:n.protocol.slice(0,-1),domain:n.hostname,query:n.search.substring(1),path:r,hash:n.hash}}function oe(){var e=H()&&$();return e?e.href:""}var se=function(e){return{pid:e.pid,view_id:e.viewId,url:oe()}},ae=function(e){var t=e.config(),n=se(t);return n.context=e.context?e.context.toString():{},n},ce=function(e,t){void 0===t&&(t=!1);var r=ae(e);return t&&(r.timestamp=J()),function(t){e.report(n(n({},t),{overrides:r}))}},ue="view_0",le=function(e){return function(t,r){var i=ae(e),o=function(r){var o;r.viewId&&r.viewId!==(null===(o=e.config())||void 0===o?void 0:o.viewId)&&(t(i),i=n(n({},ae(e)),se(r)))};e.on("beforeConfig",o),r((function(){e.off("beforeConfig",o)}))}},de="f_view_0",fe=function(e){return function(t,n){var r=ae(e);n(u,(function(e){r&&e(r)}))}},pe=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar},he=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=pe(H());n&&(n.errors||(n.errors=[]),n.errors.push(e))},me=function(e,t){var n=e&&new e(t);return[function(e,t){n&&e&&n.observe(e,t)},function(){return n&&n.disconnect()}]},_e=function(e){var t=e&&e.timing||void 0;return[t,function(){return e&&e.now?e.now():(Date.now?Date.now():+new Date)-(t&&t.navigationStart||0)},function(t){var n=(e||{}).getEntriesByType;return m(n)&&n.call(e,t)||[]},function(){var t=(e||{}).clearResourceTimings;m(t)&&t.call(e)},function(t){var n=(e||{}).getEntriesByName;return m(n)&&n.call(e,t)||[]}]},ge=function(e){var t={url:oe(),timestamp:J()},n=e.config();return(null==n?void 0:n.pid)&&(t.pid=n.pid),(null==e?void 0:e.context)&&(t.context=e.context.toString()),t},ve=function(e,t){return function(n){var r=function(e){return e.overrides=t,e};e.on("report",r),n(),e.off("report",r)}},ye=function(e,t,n,r){return void 0===r&&(r=!1),e.addEventListener(t,n,r),function(){e.removeEventListener(t,n,r)}},be=function(e,t,n,r){return void 0===r&&(r=!1),e.addEventListener(t,n,r),function(){e.removeEventListener(t,n,r)}};var we=function(e){var t=!1;return[function(n){t||(t=!0,e&&e(n))}]},ke=function(e,t){var n,r=K();if(r){var i=r.createElement("script");i.src=e,i.crossOrigin="anonymous",i.onload=t,null===(n=r.head)||void 0===n||n.appendChild(i)}},Ee=function(e,t){return d(e)?n(n({},t),e):!!e&&t},Se=function(){return!!btoa&&!!atob};var Te=function(e){try{var t=localStorage.getItem(e),n=t;t&&"string"==typeof t&&(n=JSON.parse((s=t,Se()?decodeURI(atob(s)):s)));var r=n,i=r.expires,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(r,["expires"]);return i>=J()?o:void 0}catch(a){return}var s},Ie=function(e,t,r){var i;if(!(r<=0))try{localStorage.setItem(e,(i=JSON.stringify(n(n({},t),{expires:J()+r})),Se()?btoa(encodeURI(i)):i))}catch(o){}},xe=function(e){return!1===e?0:!0!==e&&void 0!==e&&_(e)?e:7776e6},Oe="xhr_0",Ne=function(e){return function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return t=r(n,2),this._method=t[0],this._url=t[1],e.apply(this,n)}},Ae=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._reqHeaders=this._reqHeaders||{};var i=r(t,2),o=i[0],s=i[1];return this._reqHeaders[o]=s,e&&e.apply(this,t)}},Re=function(e,t){var n,r=(n=new RegExp("\\/monitor_web\\/collect|\\/monitor_browser\\/collect\\/batch","i"),function(e){return n.test(e)});return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];(this._start=J(),this._data=null==n?void 0:n[0],r(this._url))||function(e,t){return N(e,"onreadystatechange",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return 4===this.readyState&&t(e),n&&n.apply(this,r)}}))}(this,t([this._method,this._url,this._start,this]))();return e.apply(this,n)}},Le=function(e){return function(t,n){if(e){var r=[];r.push(N(e,"open",Ne)()),r.push(N(e,"setRequestHeader",Ae)()),r.push(N(e,"send",Re)(t)),n((function(){r.forEach((function(e){return e()}))}))}}},Ce=function(e,t){return function(n,r){void 0===r&&(r={});var i=t([n,r]),o=e(n,r);return o.then((function(e){i(e)}),(function(){i(void 0)})),o}},Pe=["fetch_0",function(e,t){var n=H();if(n&&fetch){var r=[];r.push(N(n,"fetch",Ce)(e)),t((function(){r.forEach((function(e){return e()}))}))}}],Me=["resource"],De=["longtask"],je=function(e,t,n){var i=r(function(e,t,n){var r=e&&new e((function(e,r){e.getEntries?e.getEntries().forEach((function(e,n,i){return t(e,n,i,r)})):n&&n()}));return[function(t){if(!e||!r)return n&&n();try{r.observe({entryTypes:t})}catch(i){return n&&n()}},function(t,o){if(!e||!r)return n&&n();try{var s={type:t,buffered:!0};!function(e){return void 0===e}(o)&&(s.durationThreshold=o),r.observe(s)}catch(i){return n&&n()}r.observe({type:t,buffered:!1})},function(){return r&&r.disconnect()}]}(e,t),3),o=i[0],s=i[2];return o(n),s},Be=["longtask_0",function(e,t){var n=ee();n&&t(je(n,e,De))}],Fe=["resource_0",function(e,t){var n=ee();n&&t(je(n,e,Me))}],Ue="pageview",Ge="session",qe="js_error",We="http",ze="custom",Ve="performance",Je="action",He={sampleRate:1,origins:[]},Ke=function(){var e=window&&(window.crypto||window.msCrypto);if(void 0!==e&&e.getRandomValues){var t=new Uint16Array(8);e.getRandomValues(t);var n=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return n(t[0])+n(t[1])+n(t[2])+n(t[3])+n(t[4])+n(t[5])+n(t[6])+n(t[7])}return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/[x]/g,(function(){return(16*Math.random()|0).toString(16)}))},$e=function(e){var t=Ee(e,He);if(t&&L(t.sampleRate))return function(e,n){var r=t.origins;r.length&&I(r,e)&&n("traceparent","03-"+Ke()+"-"+Ke().substring(16)+"-01")}},Ye=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Xe=new RegExp("(bearer|session)","i"),Qe=function(e,t){return!e||!t||(Ye.test(e)||Xe.test(t))},Ze=function(e,t){try{if(t){var r=e.request.url;e.request.url=t(r),e.extra=n(n({},e.extra),{original_url:r})}}catch(i){}},et=function(e,t,n){var i=r(t,2),o=i[0],s=i[1],a=n.setTraceHeader,c=n.ignoreUrls,l=n.setContextAtReq,d=n.extractUrl;e.push(o[0]((function(e){var t=r(e,4);t[0];var i=t[1];t[2];var o=t[3];if(!i)return u;var f=re(i);if(I(c,f))return u;a&&a(f,(function(e,t){return o.setRequestHeader(e,t)}));var p=l(),h=void 0,m=s()[0]((function(e){f===e.name&&!h&&(h=e)}));return function(e){var t=tt(e,n);setTimeout((function(){h&&(t.response.timing=h),Ze(t,d),p&&p({ev_type:We,payload:t}),m()}),100)}})))};var tt=function(e,t){var n,i=e._method,o=e._reqHeaders,s=e._url,a=e._start,c=e._data,u={api:"xhr",request:{url:re(s),method:(i||"").toLowerCase(),headers:o&&(n=o,Object.keys(n).reduce((function(e,t){return!Qe(t,n[t])&&(e[t.toLowerCase()]=n[t]),e}),{})),timestamp:a},response:{status:e.status||0,is_custom_error:!1,timestamp:J()},duration:J()-a};"function"==typeof e.getAllResponseHeaders&&(u.response.headers=function(e){return g(e)&&e?e.split("\r\n").reduce((function(e,t){if(g(t)){var n=r(t.split(": "),2),i=n[0],o=n[1];!Qe(i,o)&&(e[i.toLowerCase()]=o)}return e}),{}):{}}(e.getAllResponseHeaders()));var l=u.response.status,d=t.collectBodyOnError,f=t.extraExtractor;try{var p=null==f?void 0:f(e.response,u,c);p&&(u.extra=p),p&&(u.response.is_custom_error=!0),d&&(p||l>=400)&&(u.request.body=c?""+c:void 0,u.response.body=e.response?""+e.response:void 0)}catch(h){}return u};function nt(e,t,n){var r,i=null===(r=e.config())||void 0===r?void 0:r.plugins[t];return Ee(i,n)}var rt="ajax",it={autoWrap:!0,setContextAtReq:function(){return l},ignoreUrls:[],collectBodyOnError:!1};var ot=function(e,t,n){var i=r(t,2),o=i[0],s=i[1],a=n.setTraceHeader,c=n.ignoreUrls,l=n.setContextAtReq,d=n.extractUrl,f=window.Headers,p=window.Request;p&&f&&e.push(o[0]((function(e){var t=r(e,2),i=t[0],o=t[1],h=re(i instanceof p?i.url:i);if(!st(h)||I(c,h))return u;a&&a(h,(function(e,t){return ct(e,t,i,o,p,f)}));var m=l(),_=J(),g=void 0,v=s()[0]((function(e){h===e.name&&!g&&(g=e)}));return function(e){var t,r,s=ft(i,o,e,p,f,n,_),a=(t=function(e){g&&(e.response.timing=g),Ze(e,d),m&&m({ev_type:We,payload:e}),v()},r=!1,function(e){r||(r=!0,t(e))});setTimeout((function(){a(s)}),1e3)}})))},st=function(e){if(!g(e))return!1;var t=r(e.split(":"),2),n=t[0];return!t[1]||"http"===n||"https"===n},at=function(e,t){return e instanceof t},ct=function(e,t,r,i,o,s){var a;at(r,o)?r.headers.set(e,t):i.headers instanceof s?i.headers.set(e,t):i.headers=n(n({},i.headers),((a={})[e]=t,a))},ut=function(e,t,n){var r=t&&t.method||"get";return at(e,n)&&(r=e.method||r),r.toLowerCase()},lt=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];try{return t.reduce((function(t,n){return new e(n||{}).forEach((function(e,n){return!Qe(n,e)&&(t[n]=e)})),t}),{})}catch(nr){return{}}},dt=function(e,t,n){return at(e,n)?e.body:null==t?void 0:t.body},ft=function(e,t,n,r,i,o,s){var a={api:"fetch",request:{method:ut(e,t,r),timestamp:s,url:re(e instanceof r?e.url:e),headers:lt(i,e.headers,t.headers)},response:{status:n&&n.status||0,is_custom_error:!1,timestamp:J()},duration:J()-s},c=o.collectBodyOnError,l=o.extraExtractor,d=function(){var n;c&&(a.request.body=null===(n=dt(e,t,r))||void 0===n?void 0:n.toString())};if(n)try{var f=lt(i,n.headers);a.response.headers=f;try{-1!==(f["content-type"]||"").indexOf("application/json")&&l&&n.clone().json().then((function(n){var i,o=l(n,a,null===(i=dt(e,t,r))||void 0===i?void 0:i.toString());o&&(a.extra=o,a.response.is_custom_error=!0,d())})).catch(u)}catch(p){}n.status>=400&&d()}catch(nr){}else d();return a},pt="fetch",ht={autoWrap:!0,setContextAtReq:function(){return l},ignoreUrls:[],collectBodyOnError:!1};var mt=["name","message","stack","filename","lineno","colno"],_t=function(e){var t,n;return!function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return!0;default:return e instanceof Error}}(e)?(p(e)||(n=e,"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(n){return!1}}(n,Event))||g(e))&&(t={message:x(e)}):t=function(e,t){return e&&d(e)?t.reduce((function(t,n){return t[n]=e[n],t}),{}):e}(e,mt),t},gt=function(e){return t=e,"[object ErrorEvent]"===Object.prototype.toString.call(t)?_t(e.error):function(e){return"[object PromiseRejectionEvent]"===Object.prototype.toString.call(e)}(e)?function(e){var t;try{var r=void 0;if("reason"in e?r=e.reason:"detail"in e&&"reason"in e.detail&&(r=e.detail.reason),r){var i=_t(r);return n(n({},i),{name:null!==(t=i&&i.name)&&void 0!==t?t:"UnhandledRejection"})}}catch(o){}}(e):_t(e);var t},vt="jsError",yt=function(e){return"hidden"===e.visibilityState},bt=["hidden_3",function(e,t){var n=K(),r=H();if(n&&r){var i=function(t){e("pagehide"===t.type||yt(n))},o=be(n,"visibilitychange",i,!0),s=ye(r,"pagehide",i,!0);t((function(){o(),s()}),(function(e){e(yt(n))}))}}],wt=function(e){return"complete"===e.readyState},kt=["load_1",function(e,t){var n=H(),r=K();if(n&&r){var i=!1,o=u,s=function(){setTimeout((function(){e(),i=!0}),0)};wt(r)?s():o=ye(n,"load",s,!1),t((function(){o()}),(function(e){i&&e()}))}}],Et=["unload_0",function(e,t){var n=H();if(n){var i=r(we(e),1)[0],o=function(){i()},s=[];["unload","beforeunload","pagehide"].forEach((function(e){s.push(ye(n,e,o,!1))})),t((function(){s.forEach((function(e){return e()}))}))}}],St=["activated_0",function(e,t){var n=K();if(n){var r=!1,i=u,o=function(){e(),r=!0};n&&n.prerendering?i=be(n,"prerenderingchange",o,!0):o(),t((function(){i()}),(function(e){r&&e()}))}}],Tt=["hash_0",function(e,t){var n=H();if(n){var r=ye(n,"hashchange",(function(){return e(location.href)}),!0);t((function(){r()}))}}],It=["history_0",function(e,t){var n=Y(),r=H();if(n&&r){var i=[],o=function(){return e(location.href)},s=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{e.apply(n,t)}finally{o()}}};i.push(O(n,"pushState",s)(),O(n,"replaceState",s)()),i.push(ye(r,"popstate",o,!0)),t((function(){i.forEach((function(e){return e()}))}))}}],xt=function(e){return Ot(e,J())},Ot=function(e,t){return e+"_"+t},Nt=function(e){return function(t,n){e(function(e,t){return{ev_type:Ue,payload:{pid:t,source:e}}}(t,n))}},At=function(e){return"manual"===e},Rt="error_weight",Lt="duration_apdex",Ct="perf_apdex",Pt=function(e,t){var n=e[0]+e[1]+e[2],r=e[0]/n;return e[2]/n>t.frustrating_threshold?2:r>t.satisfying_threshold||0===n?0:1},Mt=function(e,t){return function(n,r){var i=n.payload;switch(n.ev_type){case Ve:var o=i.name;i.isSupport&&e(r[Ct],o,i.value);break;case Je:e(r[Ct],"action",i.duration||0);break;case qe:t(r[Rt],0);break;case We:if(i.response.is_custom_error||i.response.status>=400)t(r[Rt],1);else{var s=i.response.timing;s&&e(r[Lt],0,s.duration)}break;case"resource_error":t(r[Rt],2);break;case"blank_screen":t(r[Rt],3);break;case"resource":e(r[Lt],1,i.duration);break;case"performance_longtask":i.longtasks.forEach((function(t){e(r[Lt],2,t.duration)}))}}},Dt=function(){var e,t,n=function(){e=[0,0,0],t=function(){var e;return(e={error_count:[0,0,0,0],duration_count:[0,0,0]})[Ct]={},e}()};n();return[function(n,r,i){var o=n&&n[r];if(o&&!(i<=0)){var s=i<(o[0].threshold||0)?0:i>(o[1].threshold||0)?2:1;if(e[s]+=o[s].weight,"string"==typeof r){var a=Ot(r,s),c=t[Ct][a];t[Ct][a]=(c||0)+1}else 2===s&&(t.duration_count[r]+=1)}},function(n,r){n&&(e[2]+=n[r],t.error_count[r]+=1)},function(){return[e,t]},n]},jt=function(e,t,n,i){var o,s,a=i.sendInit,c=i.initPid,u=i.routeMode,l=i.extractPid,d=i.onPidUpdate,f=At(u)?function(){return""}:function(e){return function(t){var n;return"hash"===e?(null===(n=ie(t).hash)||void 0===n?void 0:n.replace(/^#/,""))||"/":ie(t).path}}(u),p=l||function(){},h=r(function(e,t,n,r){var i=n,o=t;return r&&r(t),[function(t,n,s){"user_set"!==t&&n!==i?(i=n,o=null!=s?s:i,r&&r(o),e(t,o)):"user_set"===t&&n!==o&&(o=n,r&&r(o),e(t,o))},function(){t&&e("init",t)}]}(Nt(e),c||function(e){var t;return null!==(t=p(e))&&void 0!==t?t:f(e)}(location.href),f(location.href),d),2),m=h[0],_=h[1];if(!At(u)){var g=r((o=function(e,t){return m(e,f(t),p(t))},s="",[function(e,t){t!==s&&o(e,s=t)}]),1)[0];n.length&&n.forEach((function(e){return t.push(e[0]((function(e){return g(u,e)})))}))}return a&&_(),[m.bind(null,"user_set")]},Bt=function(e,t,n,i){var o,s,a,c=r(n,2),u=c[0],l=c[1],d=2===i.apdex,f=void 0,p=void 0,h=void 0,m=!1,_=r(Dt(),4),g=_[0],v=_[1],y=_[2],b=_[3],w=r(Dt(),4),k=w[0],E=w[1],S=w[2],T=w[3],I=r((o={start:J(),end:0,time_spent:0,is_bounced:!1,entry:"",exit:"",p_count:0,a_count:0},[function(e,t){var n=r(e,3),i=n[0],s=n[1],a=n[2];o.end=J(),o.time_spent+=t&&t.time_spent||0,o.last_page=t,o.p_count+=1,o.rank=i,o.apdex=s,o.apdex_detail=a;var c=K();c&&(o.is_bounced=!wt(c))},function(e,t){o.time_spent+=e.time_spent,o.p_count+=1,o.exit=t},function(){o.a_count+=1},function(e){o.entry=e,o.exit=e},function(){return o}]),5),x=I[0],O=I[1],N=I[2],A=I[3],R=I[4],L=r((s=0,a=void 0,[function(e){if(e){if(!a)return;s+=J()-a,a=void 0}else a=J()},function(){a&&(s+=J()-a);var e=s;return s=0,a=J(),e}]),2),C=L[0],P=L[1];t.push(u[0](C)),!d&&t.push(l[0]((function(){if(m){var t=r(S(),2),n=t[0],i=t[1],o=Pt(n,h);x([o,n,i],j()),e({ev_type:Ge,payload:R()}),T()}})));var M=Mt(g,v),D=Mt(k,E),j=function(){var e=r(y(),2),t=e[0],n=e[1];return{start:f[0],pid:f[1],view_id:f[2],end:J(),time_spent:P(),apdex:t,rank:Pt(t,h),detail:n}};return t.push((function(){m=!1})),[function(e,t){if(!f)return f=[J(),e,t],A(e),void(m=!(!h||!f));m&&(p=j(),O(p,e)),f=[J(),e,t],b()},function(e){m&&(d||(D(e,h),e.ev_type===Je&&N()),e.common.pid===f[1]&&M(e,h))},function(t){m&&(t.payload.last=p),e(t)},function(e){if(!e)return t.forEach((function(e){return e()})),void(t.length=0);m=!(!(h=e)||!f)}]},Ft="pageview",Ut={sendInit:!0,routeMode:"history",apdex:2};var Gt={isSupport:!0,isPolyfill:!1,isBounced:!1,isCustom:!1,type:"perf"},qt=function(e,t){return n({name:e,value:t},Gt)},Wt=function(e,t,n){var r=!1;return function(i){n.length&&n.forEach((function(e){e()})),n.length=0,r||(r=!0,t&&t(e(i)))}},zt=function(e,t){return{ev_type:Ve,payload:e,overrides:t}},Vt=function(){var e=function(){var e=X();return(0,r(_e(e),3)[2])("navigation")[0]}();return e&&e.activationStart||0},Jt="first-paint",Ht=function(e,t,n,i,o){var s=r(o,3),a=s[0],c=s[1],u=s[2],l=ee(),d=X(),f=K(),p=qt(t,0),h=Wt(zt,n,i);if(!d||!l||!f)return p.isSupport=!1,void h(p);var m=function(){if(yt(f))return p.isSupport=!1,void h(p);var t=function(e){var t=e.startTime,n=Vt();p.value=t<n?0:t-n,h(p)},n=(0,r(_e(d),5)[4])(e)[0];if(n)t(n);else{i.push(je(l,(function(n){n.name===e&&t(n)}),["paint"]));var o=u();i.push(o[0]((function(){p.isBounced=!0,h(p)})));var s=function(e){e&&h(p)},a=c();i.push((function(){return a[1](s)})),a[0](s)}};i.push((function(){return a[1](m)})),a[0](m)},Kt=5e3,$t=function(e){var t=e||{},n=t.domContentLoadedEventEnd,r=t.navigationStart;return n?n-(void 0===r?0:r):null},Yt=function(e,t){var n=e.startTime,r=e.duration;e.start=n,e.end=n+r,t.push(e)},Xt=function(e,t,n){var i=r(t,5),o=i[0],s=i[1],a=i[2],c=i[3],l=i[4];return function(t,i){var d,f=[],p=[],h=r([d={},function(e,t){return d[e]=t},function(e){return delete d[e]}],3),m=h[0],_=h[1],g=h[2];n.forEach((function(e){e.entryType===De[0]&&Yt(e,f)}));var v=0;e.push(o[0]((function(e){if("get"!==(r(e,1)[0]||"").toLowerCase())return u;var t=v+=1;return _(t,J()),function(){g(t)}}))),e.push(s[0]((function(e){var t=r(e,2),n=t[0],i=t[1];if(!window.Request||"get"!==ut(n,i,window.Request))return u;var o=v+=1;return _(o,J()),function(){g(o)}})));var y=r(l&&function(e,t){var n=["img","script","iframe","link","audio","video","source"];function i(e,t){for(var n=0;n<e.length;n++)if(w(t,e[n].nodeName.toLowerCase())||e[n].children&&i(e[n].children,t))return!0;return!1}var o=r(me(e,(function(e){for(var r=0;r<e.length;r++)("childList"===e[r].type&&i(e[r].addedNodes,n)||"attributes"===e[r].type&&w(n,e[r].target.nodeName.toLowerCase()))&&t(e[r])})),2),s=o[0];return[function(){return s(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]})},o[1]]}(l,(function(){return t(i()+Kt)}))||[],2),b=y[0],k=y[1];b&&b();var E=function(){return function(e,t,n){if(e.length>2)return n();for(var i=[],o=0;o<t.length;o++)i.push([t[o].start,0],[t[o].end,1]);for(o=0;o<e.length;o++)i.push([e[o],0]);i.sort((function(e,t){return e[0]-t[0]}));var s=e.length;for(o=i.length-1;o>=0;o--){var a=r(i[o],2),c=a[0];switch(a[1]){case 0:s--;break;case 1:if(++s>2)return c}}return 0}(function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];"number"==typeof i&&n.push(i)}return n}(m),p,i)};return k&&e.push(k),e.push(a[0]((function(e){Yt(e,f);var n=e.startTime,r=e.duration;t(n+r+Kt)}))),e.push(c[0]((function(e){var n=e.fetchStart,r=e.responseEnd;p.push({start:n,end:r}),t(E()+Kt)}))),e.push((function(){f.length=0,p.length=0})),[f,E]}},Qt=function(e,t,n,i){var o=r(n,5),s=o[0],a=o[1],c=o[2],u=o[3],l=o[4],d=qt("tti",0),f=Wt(zt,e,t),p=X(),h=ee(),m=i||{},_=m.entries,g=void 0===_?[]:_,v=m.observer;if(t.push((function(){v&&v.disconnect(),g.length=0})),!window||!XMLHttpRequest||!p||!h||h.supportedEntryTypes&&!w(h.supportedEntryTypes||[],De[0]))return d.isSupport=!1,void f(d);var y=r(_e(p),5),b=y[0],k=y[1],E=y[4],S=r(function(e){var t,n=-1/0,r=void 0,i=function(){return window.clearTimeout(r)},o=function(o){n>o||!t||(i(),r=window.setTimeout(t,o-e()),n=o)};return[function(e,n){t=e,o(n)},function(){i(),t=void 0},o]}(k),3),T=S[0],I=S[1],x=S[2],O=r(Xt(t,[s,a,c,u,Z()],g)(x,k),2),N=O[0],A=O[1];t.push(I);var R=function(e){var t=E("first-contentful-paint")[0],n=function(e,t,n,r,i){if(r-n<Kt)return null;var o=0===i.length?e:i[i.length-1].end;return r-o<Kt?null:Math.max(o,t)}((t?t.startTime:$t(b))||0,$t(b)||0,A(),k(),N);if(!n)return x(k()+1e3);e(n)},L=function(e){d.value=e,f(d)},C=N[N.length-1];T((function(){return R(L)}),Math.max(A()+Kt,C?C.end:0)),t.push(l[0]((function(){d.isSupport=!1,f(d)})))},Zt="tti";var en=["SCRIPT","STYLE","META","HEAD"],tn=function(e,t,n,r){if(!e||r.indexOf(e.tagName)>-1)return 0;var i=e.children,o=void 0===i?[]:i,s=[].slice.call(o).reduceRight((function(e,n){return e+tn(n,t+1,e>0,r)}),0);if(s<=0&&!n){if(!m(e.getBoundingClientRect))return 0;var a=e.getBoundingClientRect()||{},c=a.top,u=a.height;if(c>window.innerHeight||u<=0)return 0}return s+1+.5*t},nn=function(e,t,n){var i=r(n,2),o=i[0],s=i[1],a=K(),c=Z(),l=X(),d=l&&l.timing&&l.timing.navigationStart||void 0,f=qt("fmp",0),p=Wt(zt,e,t);if(!a||!c||!d)return f.isSupport=!1,void p(f);var h=J(),_=[],g=function(){return _.push({time:J()-h,score:tn(a&&a.body,1,!1,en)})},v=function(){if(H()&&"requestAnimationFrame"in window)return window.requestAnimationFrame}(),y=function(){if(H()&&"cancelAnimationFrame"in window)return window.cancelAnimationFrame}(),b=r(function(e,t,n,r){var i,o=!m(t)||r&&e&&e.hidden?function(e){return e(0),0}:t,s=m(n)?n:u;return[function(e){i&&s(i),i=o(e)},o,s]}(a,v,y,!0),1),w=b[0],k=r(me(c,(function(){return w(g)})),2),E=k[0],S=k[1],T=function(e){void 0===e&&(e=0);var t=function(e){var t=r(void 0===e?[]:e),n=t[0],i=t.slice(1);return i&&i.reduce((function(e,t){var n=r(e,2),i=n[0],o=n[1],s=t.score-i.score;return[t,t.time>=i.time&&o.rate<s?{time:t.time,rate:s}:o]}),[n,{time:null==n?void 0:n.time,rate:0}])[1].time||0}(_);f.value=t?t+e:0,p(f),_.length=0},I=h-(d||0);E(a,{subtree:!0,childList:!0}),t.push(S),t.push(s[0]((function(){f.isSupport=!1,p(f)}))),t.push(o[0]((function(){var e,n;e=window.setTimeout((function(){T(I)}),200),n=t,e&&n.push((function(){return clearTimeout(e)}))})))},rn="fmp",on={renderType:"CSR"};var sn=function(e){e.provide("sendEvent",(function(t){var n=function(e){if(e&&d(e)&&e.name&&g(e.name)){var t={name:e.name,type:"event"};if("metrics"in e&&d(e.metrics)){var n=e.metrics,r={};for(var i in n)_(n[i])&&(r[i]=n[i]);t.metrics=r}if("categories"in e&&d(e.categories)){var o=e.categories,s={};for(var i in o)s[i]=x(o[i]);t.categories=s}return t}}(t);n&&e.report({ev_type:ze,payload:n,extra:{timestamp:J()}})})),e.provide("sendLog",(function(t){var n=function(e){if(e&&d(e)&&e.content&&g(e.content)){var t={content:x(e.content),type:"log",level:"info"};if("level"in e&&(t.level=e.level),"extra"in e&&d(e.extra)){var n=e.extra,r={},i={};for(var o in n)_(n[o])?r[o]=n[o]:i[o]=x(n[o]);t.metrics=r,t.categories=i}return t}}(t);n&&e.report({ev_type:ze,payload:n,extra:{timestamp:J()}})}))};function an(e){return(null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||""}var cn=function(e,t){var n=e.common||{};return n.sample_rate=t,e.common=n,e},un=function(e,t,n,r,i){return e?function(e){return function(){return e}}(i(r,t)):function(){return n(t)}},ln=function(e,t,n,r){var i=E(e,t,(function(e,t){return e[t]}));if(void 0===i)return!1;var o=function(e){return"boolean"==typeof e}(i)?"bool":_(i)?"number":"string";return function(e,t,n){switch(n){case"eq":return w(t,e);case"neq":return!w(t,e);case"gt":return e>t[0];case"gte":return e>=t[0];case"lt":return e<t[0];case"lte":return e<=t[0];case"regex":return Boolean(e.match(new RegExp(t.join("|"))));case"not_regex":return!e.match(new RegExp(t.join("|")));default:return!1}}(i,function(e,t){return e.map((function(e){switch(t){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}}))}(r,o),n)},dn=function(e,t){try{return"rule"===t.type?ln(e,t.field,t.op,t.values):"and"===t.type?t.children.every((function(t){return dn(e,t)})):t.children.some((function(t){return dn(e,t)}))}catch(n){return he(n),!1}},fn=function(e,t,n,r,i){if(!t)return l;var o=t.sample_rate,s=t.include_users,a=t.sample_granularity,c=t.rules,u=t.r,d=void 0===u?Math.random():u;if(w(s,e))return function(e){return cn(e,1)};var f="session"===a,p=un(f,o,n,d,r),h=function(e,t,n,r,i,o){var s={};return Object.keys(e).forEach((function(a){var c=e[a],u=c.enable,l=c.sample_rate,d=c.conditional_sample_rules;u?(s[a]={enable:u,sample_rate:l,effectiveSampleRate:l*n,hit:un(t,l,r,i,o)},d&&(s[a].conditional_hit_rules=d.map((function(e){var s=e.sample_rate,a=e.filter;return{sample_rate:s,hit:un(t,s,r,i,o),effectiveSampleRate:s*n,filter:a}})))):s[a]={enable:u,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}})),s}(c,f,o,n,d,r);return function(e){var t;if(!p())return f&&i[0](),!1;if(!(e.ev_type in h))return cn(e,o);if(!h[e.ev_type].enable)return f&&i[1](e.ev_type),!1;if(null===(t=e.common)||void 0===t?void 0:t.sample_rate)return e;var n=h[e.ev_type],r=n.conditional_hit_rules;if(r)for(var s=0;s<r.length;s++)if(dn(e,r[s].filter))return!!r[s].hit()&&cn(e,r[s].effectiveSampleRate);return n.hit()?cn(e,n.effectiveSampleRate):((!r||!r.length)&&f&&i[1](e.ev_type),!1)}},pn=function(e,t,n){var r=t.url,i=t.data,o=t.success,s=void 0===o?u:o,a=t.fail,c=void 0===a?u:a,l=t.getResponseText,d=void 0===l?u:l,f=t.withCredentials,p=void 0!==f&&f,h=new n;h.withCredentials=p,h.open(e,r,!0),h.setRequestHeader("Content-Type","application/json"),h.onload=function(){null==d||d(this.responseText);try{if(this.responseText){var e=JSON.parse(this.responseText);s(e)}else s({})}catch(t){c(t)}},h.onerror=function(){c(new Error("Network request failed"))},h.onabort=function(){c(new Error("Network request aborted"))},h.send(i)},hn=function(){var e=Q();return e?{useBeacon:!0,get:function(t){pn("GET",t,e)},post:function(t){pn("POST",t,e)}}:{get:u,post:u}};function mn(e){var t=function(e){var t,n=e.transport,r=e.endpoint,i=e.size,c=void 0===i?o:i,u=e.wait,l=void 0===u?s:u,d=[],f=0;function p(){if(d.length){var e=this.getBatchData();n.post({url:r,data:e,fail:function(n){t&&t(n,e)}}),d=[]}}return{getSize:function(){return c},getWait:function(){return l},setSize:function(e){c=e},setWait:function(e){l=e},getEndpoint:function(){return r},setEndpoint:function(e){r=e},send:function(e){d.push(e),d.length>=c&&p.call(this),clearTimeout(f),f=setTimeout(p.bind(this),l)},flush:function(){clearTimeout(f),p.call(this)},getBatchData:function(){return d.length?a(d):""},clear:function(){clearTimeout(f),d=[]},fail:function(e){t=e}}}(e),n=t.send;return function(e){var t=H();if(t){var n=r(we(e),1)[0];["unload","beforeunload","pagehide"].forEach((function(e){ye(t,e,n,!1)}))}}((function(){if(e.transport.useBeacon){var r=function(){var e=H();return e&&e.navigator.sendBeacon?{get:function(){},post:function(t,n){e.navigator.sendBeacon(t,n)}}:{get:u,post:u}}(),i=t.getBatchData();i&&(r.post(t.getEndpoint(),i),t.clear()),t.send=function(e){r.post(t.getEndpoint(),a([e]))},function(e){var t=K(),n=H();if(t&&n){var r=u;r=be(t,"visibilitychange",(function(){"visible"===t.visibilityState&&(e(),r())}),!0)}}((function(){t.send=n}))}else t.flush()})),t}var _n="mon.zijieapi.com",gn=_n,vn="https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/plugins",yn="1.12.6",bn="SDK_SLARDAR_WEB",wn="/monitor_web/settings/browser-settings",kn="/monitor_browser/collect/batch/",En="SLARDAR",Sn=["/log/sentry/",kn,wn],Tn="session",In=["blankScreen","action"],xn={sample_rate:1,include_users:[],sample_granularity:Tn,rules:{}},On="";function Nn(e,t,n){void 0===n&&(n=Cn),function(e){var t=H(),n=K();t&&n&&("complete"!==n.readyState?ye(t,"load",(function(){setTimeout((function(){e()}),0)}),!1):e())}((function(){e.on("init",(function(){n(e,t)}))}))}var An=function(e,t,n,r){void 0===r&&(r=Pn);var i=t.config(),o=i.plugins,s=i.pluginBundle,a=e.filter((function(e){return o[e]&&!t.destroyAgent.has(e)})),c=function(){return a.forEach((function(e){return Mn(t,e,n)}))};a.every((function(e){return jn(e,n)}))?c():r(t,{name:s.name},c)},Rn=function(e,t,n,r){void 0===r&&(r=Pn);var i=t.config().plugins;e.filter((function(e){return i[e]&&!t.destroyAgent.has(e)})).forEach((function(e){jn(e,n)?Mn(t,e,n):r(t,{name:e,config:i[e]},(function(){return Mn(t,e,n)}))}))},Ln=function(e){return function(t,r){var i,o=e.config().pluginBundle;e.destroyAgent.has(t)&&e.destroyAgent.remove(t),void 0!==r&&e.set({plugins:n(n({},e.config().plugins),(i={},i[t]=r,i))}),o&&~o.plugins.indexOf(t)?An([t],e):Rn([t],e)}};function Cn(e,t,n){void 0===n&&(n=Pn);var r=e.config().pluginBundle,i=r?r.plugins:[];An(i,e,t,n),Rn(In,e,t,n),e.provide("reloadPlugin",Ln(e))}function Pn(e,t,n,r){var i=t.name,o=t.config;void 0===r&&(r=ke);var s=function(e,t,n){var r;return null!==(r=null==n?void 0:n.path)&&void 0!==r?r:e.config().pluginPathPrefix+"/"+S(t)+"."+yn+"."+On+"js"}(e,i,o);r(s,(function(){n()}))}function Mn(e,t,n){if(void 0===n&&(n=pe(H())),n){var r=Dn(n,t);if(r)try{if(e.destroyAgent.has(t))return;r.apply(e)}catch(i){he(i),R("[loader].applyPlugin failed",t,i)}else R("[loader].applyPlugin not found",t)}}function Dn(e,t){return e.plugins.filter((function(e){return e.name===t&&e.version===yn}))[0]}function jn(e,t){return void 0===t&&(t=pe(H())),!(!t||!t.plugins)&&!!Dn(t,e)}function Bn(e,t,n){void 0===n&&(n=pe(H())),n&&n.plugins&&(Dn(n,e)||n.plugins.push({name:e,version:yn,apply:t}))}function Fn(e){var t=e.plugins||{};for(var r in t)t[r]&&!d(t[r])&&(t[r]={});return n(n({},e),{plugins:t})}function Un(e){return d(e)&&"bid"in e}function Gn(e){return n({},e)}function qn(e){var t;if(!e)return{};var n=e.sample,r=e.plugins,i=e.timestamp,o=e.quota_rate,s=void 0===o?1:o,a=e.apdex;if(!n)return{};var c=n.sample_rate,u=n.sample_granularity,l=void 0===u?Tn:u,d=n.include_users,f=n.rules;return{sample:{include_users:d,sample_rate:c*s,sample_granularity:l,rules:(void 0===f?[]:f).reduce((function(e,t){var n=t.name,r=t.enable,i=t.sample_rate,o=t.conditional_sample_rules;return e[n]={enable:r,sample_rate:i,conditional_sample_rules:o},e}),{})},plugins:{heatmap:null!==(t=null==r?void 0:r.heatmap)&&void 0!==t&&t},apdex:a,serverTimestamp:i}}var Wn=function(e,t){return void 0===t&&(t=kn),(e&&e.indexOf("//")>=0?"":"https://")+e+t},zn=function(e,t){return void 0===t&&(t=wn),(e&&e.indexOf("//")>=0?"":"https://")+e+t},Vn=function(){return M()},Jn=function(e){var t=[];return e.observe=function(e){t.push(e)},e.push=function(){for(var n,o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return o.forEach((function(e){t.forEach((function(t){return t(e)}))})),(n=[].push).call.apply(n,i([e],r(o),!1))},e},Hn=function(){var e,t,n,r=H(),i=K();if(r&&i)return(null===(n=null===(t=null===(e=ne())||void 0===e?void 0:e.getAttribute("src"))||void 0===t?void 0:t.match(/globalName=(.+)$/))||void 0===n?void 0:n[1])||"Slardar"},Kn=function(e){return En+e},$n=function(e,t){try{var n=localStorage.getItem(e);if(!n||!Se()||"{"!==n[0])return;Ie(e,JSON.parse(n),t)}catch(A){}},Yn=function(e,t){void 0===e&&(e="");var n={userId:M(),deviceId:M()};if(t<=0)return n;var r=Kn(e);return $n(r,t),Te(r)||n},Xn=function(e){var t=e.bid,n=e.userId,r=e.deviceId,i=e.storageExpires,o=Kn(t);Ie(o,{userId:n,deviceId:r},xe(i))},Qn={get:function(){return this.__SLARDAR__REPALCE__HOLDER__}},Zn=function(e){var t,r,i=e,o={},s=Qn.get(),a=u,c=u;return{getConfig:function(){return i},setConfig:function(e){return o=n(n({},o),e||{}),l(),t||(t=e,i.useLocalConfig||!i.bid?(r={},a()):s?d():er(i.transport,i.domain,i.bid,(function(e){s=e,d()}))),i},onChange:function(e){c=e},onReady:function(e){a=function(){Xn(i),e()},r&&a()}};function l(){var t=n(n(n({},e),r||{}),o);t.plugins=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},r=0;r<e.length;)n=y(n,e[r++]);return n}(e.plugins,(null==r?void 0:r.plugins)||{},o.plugins||{}),t.sample=tr(tr(e.sample,null==r?void 0:r.sample),o.sample),i=t,c()}function d(){r=qn(s),l(),a()}};function er(e,t,n,r){e.get({withCredentials:!0,url:zn(t)+"?bid="+n+"&store=1",success:function(e){r(e.data||{})},fail:function(){r({sample:{sample_rate:.001}})}})}function tr(e,t){if(!e||!t)return e||t;var o=n(n({},e),t);return o.include_users=i(i([],r(e.include_users||[]),!1),r(t.include_users||[]),!1),o.rules=i(i([],r(Object.keys(e.rules||{})),!1),r(Object.keys(t.rules||{})),!1).reduce((function(o,s){var a,c;return s in o||(s in(e.rules||{})&&s in(t.rules||{})?(o[s]=n(n({},e.rules[s]),t.rules[s]),o[s].conditional_sample_rules=i(i([],r(e.rules[s].conditional_sample_rules||[]),!1),r(t.rules[s].conditional_sample_rules||[]),!1)):o[s]=(null===(a=e.rules)||void 0===a?void 0:a[s])||(null===(c=t.rules)||void 0===c?void 0:c[s])),o}),{}),o}var nr,rr={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:n(n({},e.extra||{}),e.overrides||{})}}},ir=function(e,t){var r=t||{},i=r.pid,o=void 0===i?"":i,s=r.viewId,a=void 0===s?"":s,c={url:oe(),timestamp:J(),sdk_version:yn,sdk_name:bn,pid:o,view_id:a};return n(n({},e),{extra:n(n({},c),e.extra||{})})},or=function(e){e.on("report",(function(t){return ir(t,e.config())}))},sr={sri:"reportSri",st:"reportResourceError",err:"captureException",reject:"captureException"},ar=function(e){return Object.keys(e).reduce((function(e,t){return e[t]=[],e}),{})},cr=function(e){return Object.keys(e).reduce((function(t,n){return t[e[n]]?t[e[n]].push(n):t[e[n]]=[n],t}),{})},ur=function(e,t,r){return function(i,o,s,a){var c;void 0===s&&(s=J()),void 0===a&&(a=location.href);var u=n(n({},ge(e)),{url:a,timestamp:s});t[i]&&(e[r[i]]?ve(e,u)((function(){e[r[i]](o)})):null===(c=t[i])||void 0===c||c.push([o,u]))}},lr=function(e,t,n){return function(i){i in n&&n[i].forEach((function(n){var o;null===(o=t[n])||void 0===o||o.forEach((function(t){var n=r(t,2),o=n[0],s=n[1];ve(e,s)((function(){e[i](o)}))})),t[n]=null}))}},dr=function(e,t){return"err"===t?!1!==E(e,"plugins."+vt+".onerror",(function(e,t){return e[t]})):"reject"!==t||!1!==E(e,"plugins."+vt+".onunhandledrejection",(function(e,t){return e[t]}))},fr=function(e,t){var n;void 0===t&&(t=sr);var i=ar(t),o=cr(t),s=ur(e,i,t);(null===(n=e.p)||void 0===n?void 0:n.a)&&"observe"in e.p.a&&e.p.a.observe((function(t){var n=r(t,5);n[0];var i=n[1],o=n[2],a=n[3],c=n[4],u=e.config();dr(u,i)&&s(i,o,a,c)})),e.on("init",(function(){var t,n=e.config();null===(t=e.p)||void 0===t||t.a.forEach((function(e){var t=r(e,5);t[0];var i=t[1],o=t[2],a=t[3],c=t[4];dr(n,i)&&s(i,o,a,c)})),e.p&&e.p.a&&(e.p.a.length=0),e.provide("precollect",(function(e,t,r,i){void 0===r&&(r=J()),void 0===i&&(i=location.href),dr(n,e)&&s(e,t,r,i)}))})),e.on("provide",lr(e,i,o))},pr=function(e){var t=r(e,2),n=t[0],i=t[1];return{ev_type:qe,payload:{error:gt(n),breadcrumbs:[],extra:i||{}},extra:{bid:"slardar_sdk"}}},hr=function(e,t){void 0===t&&(t=.001);var n=pe(H());n&&(n.errors||(n.errors=[]),"observe"in n.errors||L(t)&&(n.errors=Jn(n.errors),n.errors.forEach((function(t){e.report(pr(t))})),n.errors.observe((function(t){e.report(pr(t))}))))},mr=function(e){var t,r=!1;e.on("init",(function(){t=(new Date).getTime(),e.on("config",(function(){var i,o=null===(i=e.config())||void 0===i?void 0:i.serverTimestamp;if(!(isNaN(o)||Number(o)<=0||r)){r=!0;var s=(new Date).getTime();if(s-t<700&&o){var a=o-(s+t)/2;!isNaN(a)&&(a>0||a<-6e5)&&e.on("beforeBuild",(function(e){var t;return n(n({},e),{extra:n(n({},null!==(t=e.extra)&&void 0!==t?t:{}),{sdk_offset:null!=a?a:0})})}))}}}))}))},_r=function(e,t){var r={};return r.bid=t.bid,r.user_id=t.userId,r.device_id=t.deviceId,r.session_id=t.sessionId,r.release=t.release,r.env=t.env,n(n({},e),{extra:n(n({},r),e.extra||{})})},gr=function(e){e.on("beforeBuild",(function(t){return _r(t,e.config())}))},vr=function(e){e.on("start",(function(){var t=e.config().bid,n=e.getSender();n.setEndpoint(n.getEndpoint()+"?biz_id="+t)}))},yr=function(e){var t=xe(e.storageExpires),n=Yn(e.bid,t);return{bid:"",pid:"",viewId:xt("_"),userId:n.userId,deviceId:n.deviceId,storageExpires:t,sessionId:Vn(),domain:_n,pluginBundle:{name:"commonMonitors",plugins:["breadcrumb","jsError","performance","resourceError","resource"]},pluginPathPrefix:vn,plugins:{ajax:{ignoreUrls:Sn},fetch:{ignoreUrls:Sn},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1,heatmap:!1},release:"",env:"production",sample:xn,transport:hn()}},br=function(e){var t=void 0===e?{}:e,o=t.createSender,s=void 0===o?function(e){return mn({size:20,endpoint:Wn(e.domain),transport:e.transport})}:o,a=t.builder,c=void 0===a?rr:a,u=t.createDefaultConfig,l=G({validateInitConfig:Un,initConfigNormalizer:Fn,userConfigNormalizer:Gn,createSender:s,builder:c,createDefaultConfig:void 0===u?yr:u,createConfigManager:Zn});hr(l),q(l);var d=pe(H());!function(e,t){var n=t||{},i={};e.provide("setFilter",(function(e,t){i[e]||(i[e]=[]),i[e].push(t)})),e.provide("initSubject",(function(t){var o=r(t,2),s=o[0],a=o[1],c=function(e){return e.split("_")[0]}(s),u=!!c&&i[c];return n[s]||(n[s]=B(a,(function(){n[s]=void 0}))),u?V(e,[s,F(n[s],u)]):n[s]})),e.provide("getSubject",(function(e){return n[e]})),e.provide("privateSubject",{})}(l,d&&d.subject),mr(l),gr(l),or(l),function(e){var t=te(),r=an(t);t&&(t.onchange=function(){r=an(t)}),e.on("report",(function(e){return n(n({},e),{extra:n(n({},e.extra||{}),{network_type:r})})}))}(l),vr(l);var f=W(l,ge,(function(e,t,n){return ve(e,t)((function(){var e=r(n),t=e[0],o=e.slice(1);l[t].apply(l,i([],r(o),!1))}))}));return function(e,t){e.on("init",(function(){var n=[],r=function(r){r.forEach((function(r){var i=r.name;w(n,i)||(n.push(i),r.setup(e),t&&t(i,r.setup),e.destroyAgent.set(i,i,[function(){n=k(n,i),r.tearDown&&r.tearDown()}]))}))};e.provide("applyIntegrations",r);var i=e.config();i&&i.integrations&&r(i.integrations)}))}(f,Bn),f},wr=((nr={})[Ft]=function(e){e.on("init",(function(){var t,i=null===(t=e.config())||void 0===t?void 0:t.plugins[Ft];!function(e,t){var i,o=Ee(t,Ut);if(o&&$()){var s=o.routeMode,a=o.apdex,c=e.report.bind(e),l=u;if(a){var d=[],f=r(Bt(e.report.bind(e),d,[z(e,bt),z(e,Et)],o),4),p=f[0],h=f[1],m=f[2],_=f[3];c=m,l=p,e.on("send",h),d.push((function(){return e.off("send",h)})),e.on("start",(function(){_(e.config().apdex)})),U(e,Ft,Ge,d)}var g=[],v=r(jt(c,g,At(s)?[]:[e.initSubject(Tt),e.initSubject(It)],n(n({},o),{initPid:null===(i=e.config())||void 0===i?void 0:i.pid,onPidUpdate:function(t){var n=xt(t);l(t,n),e.set({pid:t,viewId:n,actionId:void 0})}})),1)[0];V(e,[de,fe(e)],-1);var y=function(){v(e.config().pid)};e.on("config",y),g.push((function(){return e.off("config",y)})),U(e,Ft,Ue,g),e.provide("sendPageview",v)}}(e,i)}))},nr[rt]=function(e){e.on("init",(function(){var t=nt(e,rt,it);if(t){var r=[],i=n(n({},t),{setContextAtReq:function(){return ce(e,!0)},setTraceHeader:$e(t.trace)}),o=function(){return z(e,Fe)};i.autoWrap&&et(r,[z(e,[Oe,Le(XMLHttpRequest&&XMLHttpRequest.prototype)]),o],i),U(e,rt,We,r),e.provide("wrapXhr",(function(e){function t(){var t=new e;return et(r,[B(Le(t)),o],i),t}return t.prototype=new e,["DONE","HEADERS_RECIEVED","LOADING","OPENED","UNSENT"].forEach((function(n){t[n]=e[n]})),t}))}}))},nr[pt]=function(e){e.on("init",(function(){var t=nt(e,pt,ht);if(t){var r=[],i=n(n({},t),{setContextAtReq:function(){return ce(e,!0)},setTraceHeader:$e(t.trace)}),o=function(){return z(e,Fe)};i.autoWrap&&ot(r,[z(e,Pe),o],i),U(e,pt,We,r),e.provide("wrapFetch",(function(e){var t=void 0;return ot(r,[B((function(n){t=Ce(e,n)})),o],i),t}))}}))},nr[Zt]=function(e){e.on("init",(function(){nt(e,Zt,{})&&function(e){var t=[];Qt(ce(e),t,[z(e,[Oe,Le(XMLHttpRequest&&XMLHttpRequest.prototype)]),z(e,Pe),z(e,Be),z(e,Fe),V(e,[ue,le(e)])],e.pp),U(e,Zt,Ve,t)}(e)}))},nr[rn]=function(e){e.on("init",(function(){var t=nt(e,rn,on);t&&function(e,t){void 0===t&&(t=on);var n=[];"SSR"===t.renderType?Ht(Jt,rn,ce(e),n,[z(e,St),function(){return z(e,bt)},function(){return z(e,Et)}]):nn(ce(e),n,[z(e,kt),V(e,[ue,le(e)])]),U(e,rn,Ve,n)}(e,t)}))},nr),kr=function(e){void 0===e&&(e={});var t=br(e);return function(e){e.on("start",(function(){var t=e.config(),n=t.userId,r=t.sample,i=fn(n,r,L,C,[function(){e.destroy()},function(t){e.destroyAgent.removeByEvType(t)}]);e.on("build",i)}))}(t),fr(t),sn(t),Object.keys(wr).forEach((function(e){Bn(e,wr[e]),wr[e](t)})),Nn(t),t.provide("create",kr),t},Er="precollect",Sr=3e5;var Tr=kr(),Ir=H();Ir&&function(e,t){if("addEventListener"in e){t.pcErr=function(n){var r=(n=n||e.event).target||n.srcElement||{};r instanceof Element||r instanceof HTMLElement?t(Er,"st",{tagName:r.tagName,url:r.getAttribute("href")||r.getAttribute("src")}):t(Er,"err",n.error)},t.pcRej=function(n){n=n||e.event,t(Er,"reject",n.reason||n.detail&&n.detail.reason)};var n=[];n.push(ye(e,"error",t.pcErr,!0)),n.push(ye(e,"unhandledrejection",t.pcRej,!0)),setTimeout((function(){n.forEach((function(e){return e()}))}),Sr)}"PerformanceObserver"in e&&"PerformanceLongTaskTiming"in e&&(t.pp={entries:[]},t.pp.observer=new PerformanceObserver((function(e){t.pp.entries=t.pp.entries.concat(e.getEntries())})),t.pp.observer.observe({entryTypes:["longtask"]}),setTimeout((function(){t.pp.observer.disconnect()}),Sr))}(Ir,Tr),t.kT=kr},7685:function(e){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),s=Math.max(i,o),a=0,c=e.map([t,n],(function(t){var n=s-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(c[0][s]>c[1][s])return 1;if(c[0][s]===c[1][s]){if(s===a)return 0;s-=1}else if(c[0][s]<c[1][s])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var a=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=o.length;t<n;t+=1)a();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},o=n(18);function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],(n=null)&&s(t.prototype,n),r&&s(t,r),e}();t.default=a,e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),o=c(n(94)),s=c(n(95)),a=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},o=0;if(Object.keys(e).forEach((function(t){var s=e[t];"string"==typeof s?(i[t]=s,o+=1):"object"==typeof s&&(n[t]=s,r+=1)})),r>0){var s=Object.keys(n),c=a.default.find(s,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(n[c]);if(void 0!==u)return u}var l=a.default.find(s,(function(e){return t.isPlatform(e)}));if(l){var d=this.satisfies(n[l]);if(void 0!==d)return d}}if(o>0){var f=Object.keys(i),p=a.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(a.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=s,e.exports=t.default}})},11036:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=t},65960:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var i=e[r]<<16|e[r+1]<<8|e[r+2],o=0;o<4;o++)8*r+6*o<=8*e.length?n.push(t.charAt(i>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r<e.length;i=++r%4)0!=i&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(e.charAt(r))>>>6-2*i);return n}},e.exports=n},86296:e=>{var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,i,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,s),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var f,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,r);break;case 4:l[u].fn.call(l[u].context,t,r,i);break;default:if(!c)for(f=1,c=new Array(d-1);f<d;f++)c[f-1]=arguments[f];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||r&&a.context!==r||s(this,o);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||i&&!a[c].once||r&&a[c].context!==r)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a},8200:(e,t,n)=>{var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},i=n(64346);t.default={name:"sprintf",type:"postProcessor",process:function(e,t,n){return n.sprintf?"[object Array]"===Object.prototype.toString.apply(n.sprintf)?(0,i.vsprintf)(e,n.sprintf):"object"===r(n.sprintf)?(0,i.sprintf)(e,n.sprintf):e:e},overloadTranslationOptionHandler:function(e){for(var t=[],n=1;n<e.length;n++)t.push(e[n]);return{postProcess:"sprintf",sprintf:t}}}},64346:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sprintf=r,t.vsprintf=function(e,t,n){return(n=(t||[]).slice(0)).splice(0,0,e),r.apply(null,n)};var n={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};function r(){var e=arguments[0],t=r.cache;return t[e]&&t.hasOwnProperty(e)||(t[e]=r.parse(e)),r.format.call(null,t[e],arguments)}function i(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}r.format=function(e,t){var o,s,a,c,u,l,d,f,p=1,h=e.length,m="",_=[],g=!0,v="";for(s=0;s<h;s++)if("string"===(m=i(e[s])))_[_.length]=e[s];else if("array"===m){if((c=e[s])[2])for(o=t[p],a=0;a<c[2].length;a++){if(!o.hasOwnProperty(c[2][a]))throw new Error(r("[sprintf] property '%s' does not exist",c[2][a]));o=o[c[2][a]]}else o=c[1]?t[c[1]]:t[p++];if("function"==i(o)&&(o=o()),n.not_string.test(c[8])&&n.not_json.test(c[8])&&"number"!=i(o)&&isNaN(o))throw new TypeError(r("[sprintf] expecting number but found %s",i(o)));switch(n.number.test(c[8])&&(g=o>=0),c[8]){case"b":o=o.toString(2);break;case"c":o=String.fromCharCode(o);break;case"d":case"i":o=parseInt(o,10);break;case"j":o=JSON.stringify(o,null,c[6]?parseInt(c[6]):0);break;case"e":o=c[7]?o.toExponential(c[7]):o.toExponential();break;case"f":o=c[7]?parseFloat(o).toFixed(c[7]):parseFloat(o);break;case"g":o=c[7]?parseFloat(o).toPrecision(c[7]):parseFloat(o);break;case"o":o=o.toString(8);break;case"s":o=(o=String(o))&&c[7]?o.substring(0,c[7]):o;break;case"u":o>>>=0;break;case"x":o=o.toString(16);break;case"X":o=o.toString(16).toUpperCase()}n.json.test(c[8])?_[_.length]=o:(!n.number.test(c[8])||g&&!c[3]?v="":(v=g?"+":"-",o=o.toString().replace(n.sign,"")),l=c[4]?"0"===c[4]?"0":c[4].charAt(1):" ",d=c[6]-(v+o).length,u=c[6]&&d>0?(f=l,Array(d+1).join(f)):"",_[_.length]=c[5]?v+o+u:"0"===l?v+u+o:u+v+o)}return _.join("")},r.cache={},r.parse=function(e){for(var t=e,r=[],i=[],o=0;t;){if(null!==(r=n.text.exec(t)))i[i.length]=r[0];else if(null!==(r=n.modulo.exec(t)))i[i.length]="%";else{if(null===(r=n.placeholder.exec(t)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],a=r[2],c=[];if(null===(c=n.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s[s.length]=c[1];""!==(a=a.substring(c[0].length));)if(null!==(c=n.key_access.exec(a)))s[s.length]=c[1];else{if(null===(c=n.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");s[s.length]=c[1]}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i[i.length]=r}t=t.substring(r[0].length)}return i}},56488:(e,t,n)=>{e.exports=n(8200).default},24982:e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},50474:(e,t,n)=>{e.exports=function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,(function(e){var n=t[s][1][e];return i(n||e)}),u,u.exports,e,t,n,r)}return n[s].exports}for(var o=void 0,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,r){(function(e){var n,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,s=new i(l),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),n=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){l(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(l,0)};else{var c=new e.MessageChannel;c.port1.onmessage=l,n=function(){c.port2.postMessage(0)}}var u=[];function l(){var e,t;r=!0;for(var n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}r=!1}function d(e){1!==u.push(e)||r||n()}t.exports=d}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){var r=e(1);function i(){}var o={},s=["REJECTED"],a=["FULFILLED"],c=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function l(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){r((function(){var r;try{r=t(n)}catch(i){return o.reject(e,i)}r===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,r)}))}function f(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,o.reject(e,t))}function i(t){n||(n=!0,o.resolve(e,t))}function s(){t(i,r)}var a=h(s);"error"===a.status&&r(a.value)}function h(e,t){var n={};try{n.value=e(t),n.status="success"}catch(r){n.status="error",n.value=r}return n}function m(e){return e instanceof this?e:o.resolve(new this(i),e)}function _(e){var t=new this(i);return o.reject(t,e)}function g(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var s=new Array(n),a=0,c=-1,u=new this(i);++c<n;)l(e[c],c);return u;function l(e,i){function c(e){s[i]=e,++a!==n||r||(r=!0,o.resolve(u,s))}t.resolve(e).then(c,(function(e){r||(r=!0,o.reject(u,e))}))}}function v(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var s=-1,a=new this(i);++s<n;)c(e[s]);return a;function c(e){t.resolve(e).then((function(e){r||(r=!0,o.resolve(a,e))}),(function(e){r||(r=!0,o.reject(a,e))}))}}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var n=new this.constructor(i);return this.state!==c?d(n,this.state===a?e:t,this.outcome):this.queue.push(new l(n,e,t)),n},l.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){o.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},o.resolve=function(e,t){var n=h(f,t);if("error"===n.status)return o.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=a,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=s,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},u.resolve=m,u.reject=_,u.all=g,u.race=v},{1:1}],3:[function(e,t,r){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var s=o();function a(){try{if(!s||!s.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(n){return!1}}function c(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var u=Promise;function l(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function d(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function f(e){return"string"!=typeof e&&(e=String(e)),e}function p(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var h="local-forage-detect-blob-support",m=void 0,_={},g=Object.prototype.toString,v="readonly",y="readwrite";function b(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}function w(e){return new u((function(t){var n=e.transaction(h,y),r=c([""]);n.objectStore(h).put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}function k(e){return"boolean"==typeof m?u.resolve(m):w(e).then((function(e){return m=e}))}function E(e){var t=_[e.name],n={};n.promise=new u((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function S(e){var t=_[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function T(e,t){var n=_[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function I(e,t){return new u((function(n,r){if(_[e.name]=_[e.name]||D(),e.db){if(!t)return n(e.db);E(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var o=s.open.apply(s,i);t&&(o.onupgradeneeded=function(t){var n=o.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(h)}catch(r){if("ConstraintError"!==r.name)throw r}}),o.onerror=function(e){e.preventDefault(),r(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},n(t),S(e)}}))}function x(e){return I(e,!1)}function O(e){return I(e,!0)}function N(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,i=e.version>e.db.version;if(r&&(e.version,e.version=e.db.version),i||n){if(n){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function A(e){return new u((function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){var r=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)}))}function R(e){return c([b(atob(e.data))],{type:e.type})}function L(e){return e&&e.__local_forage_encoded_blob}function C(e){var t=this,n=t._initReady().then((function(){var e=_[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return d(n,e,e),n}function P(e){E(e);for(var t=_[e.name],n=t.forages,r=0;r<n.length;r++){var i=n[r];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,x(e).then((function(t){return e.db=t,N(e)?O(e):t})).then((function(r){e.db=t.db=r;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=r})).catch((function(t){throw T(e,t),t}))}function M(e,t,n,r){void 0===r&&(r=1);try{var i=e.db.transaction(e.storeName,t);n(null,i)}catch(o){if(r>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),O(e)})).then((function(){return P(e).then((function(){M(e,t,n,r-1)}))})).catch(n);n(o)}}function D(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function j(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=_[n.name];i||(i=D(),_[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=C);var o=[];function s(){return u.resolve()}for(var a=0;a<i.forages.length;a++){var c=i.forages[a];c!==t&&o.push(c._initReady().catch(s))}var l=i.forages.slice(0);return u.all(o).then((function(){return n.db=i.db,x(n)})).then((function(e){return n.db=e,N(n,t._defaultConfig.version)?O(n):e})).then((function(e){n.db=i.db=e,t._dbInfo=n;for(var r=0;r<l.length;r++){var o=l[r];o!==t&&(o._dbInfo.db=n.db,o._dbInfo.version=n.version)}}))}function B(e,t){var n=this;e=f(e);var r=new u((function(t,r){n.ready().then((function(){M(n._dbInfo,v,(function(i,o){if(i)return r(i);try{var s=o.objectStore(n._dbInfo.storeName).get(e);s.onsuccess=function(){var e=s.result;void 0===e&&(e=null),L(e)&&(e=R(e)),t(e)},s.onerror=function(){r(s.error)}}catch(a){r(a)}}))})).catch(r)}));return l(r,t),r}function F(e,t){var n=this,r=new u((function(t,r){n.ready().then((function(){M(n._dbInfo,v,(function(i,o){if(i)return r(i);try{var s=o.objectStore(n._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var n=s.result;if(n){var r=n.value;L(r)&&(r=R(r));var i=e(r,n.key,a++);void 0!==i?t(i):n.continue()}else t()},s.onerror=function(){r(s.error)}}catch(c){r(c)}}))})).catch(r)}));return l(r,t),r}function U(e,t,n){var r=this;e=f(e);var i=new u((function(n,i){var o;r.ready().then((function(){return o=r._dbInfo,"[object Blob]"===g.call(t)?k(o.db).then((function(e){return e?t:A(t)})):t})).then((function(t){M(r._dbInfo,y,(function(o,s){if(o)return i(o);try{var a=s.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var c=a.put(t,e);s.oncomplete=function(){void 0===t&&(t=null),n(t)},s.onabort=s.onerror=function(){var e=c.error?c.error:c.transaction.error;i(e)}}catch(u){i(u)}}))})).catch(i)}));return l(i,n),i}function G(e,t){var n=this;e=f(e);var r=new u((function(t,r){n.ready().then((function(){M(n._dbInfo,y,(function(i,o){if(i)return r(i);try{var s=o.objectStore(n._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){r(s.error)},o.onabort=function(){var e=s.error?s.error:s.transaction.error;r(e)}}catch(a){r(a)}}))})).catch(r)}));return l(r,t),r}function q(e){var t=this,n=new u((function(e,n){t.ready().then((function(){M(t._dbInfo,y,(function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=o.error?o.error:o.transaction.error;n(e)}}catch(s){n(s)}}))})).catch(n)}));return l(n,e),n}function W(e){var t=this,n=new u((function(e,n){t.ready().then((function(){M(t._dbInfo,v,(function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){n(o.error)}}catch(s){n(s)}}))})).catch(n)}));return l(n,e),n}function z(e,t){var n=this,r=new u((function(t,r){e<0?t(null):n.ready().then((function(){M(n._dbInfo,v,(function(i,o){if(i)return r(i);try{var s=o.objectStore(n._dbInfo.storeName),a=!1,c=s.openKeyCursor();c.onsuccess=function(){var n=c.result;n?0===e||a?t(n.key):(a=!0,n.advance(e)):t(null)},c.onerror=function(){r(c.error)}}catch(u){r(u)}}))})).catch(r)}));return l(r,t),r}function V(e){var t=this,n=new u((function(e,n){t.ready().then((function(){M(t._dbInfo,v,(function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).openKeyCursor(),s=[];o.onsuccess=function(){var t=o.result;t?(s.push(t.key),t.continue()):e(s)},o.onerror=function(){n(o.error)}}catch(a){n(a)}}))})).catch(n)}));return l(n,e),n}function J(e,t){t=p.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,i=this;if(e.name){var o=e.name===n.name&&i._dbInfo.db?u.resolve(i._dbInfo.db):x(e).then((function(t){var n=_[e.name],r=n.forages;n.db=t;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=t;return t}));r=e.storeName?o.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;E(e);var r=_[e.name],i=r.forages;t.close();for(var o=0;o<i.length;o++){var a=i[o];a._dbInfo.db=null,a._dbInfo.version=n}var c=new u((function(t,r){var i=s.open(e.name,n);i.onerror=function(e){i.result.close(),r(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}));return c.then((function(e){r.db=e;for(var t=0;t<i.length;t++){var n=i[t];n._dbInfo.db=e,S(n._dbInfo)}})).catch((function(t){throw(T(e,t)||u.resolve()).catch((function(){})),t}))}})):o.then((function(t){E(e);var n=_[e.name],r=n.forages;t.close();for(var i=0;i<r.length;i++)r[i]._dbInfo.db=null;var o=new u((function(t,n){var r=s.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}));return o.then((function(e){n.db=e;for(var t=0;t<r.length;t++)S(r[t]._dbInfo)})).catch((function(t){throw(T(e,t)||u.resolve()).catch((function(){})),t}))}))}else r=u.reject("Invalid arguments");return l(r,t),r}var H={_driver:"asyncStorage",_initStorage:j,_support:a(),iterate:F,getItem:B,setItem:U,removeItem:G,clear:q,length:W,key:z,keys:V,dropInstance:J};function K(){return"function"==typeof openDatabase}var $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Y="~~local_forage_type~",X=/^~~local_forage_type~([^~]+)~/,Q="__lfsc__:",Z=Q.length,ee="arbf",te="blob",ne="si08",re="ui08",ie="uic8",oe="si16",se="si32",ae="ur16",ce="ui32",ue="fl32",le="fl64",de=Z+ee.length,fe=Object.prototype.toString;function pe(e){var t,n,r,i,o,s=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var u=new ArrayBuffer(s),l=new Uint8Array(u);for(t=0;t<a;t+=4)n=$.indexOf(e[t]),r=$.indexOf(e[t+1]),i=$.indexOf(e[t+2]),o=$.indexOf(e[t+3]),l[c++]=n<<2|r>>4,l[c++]=(15&r)<<4|i>>2,l[c++]=(3&i)<<6|63&o;return u}function he(e){var t,n=new Uint8Array(e),r="";for(t=0;t<n.length;t+=3)r+=$[n[t]>>2],r+=$[(3&n[t])<<4|n[t+1]>>4],r+=$[(15&n[t+1])<<2|n[t+2]>>6],r+=$[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}function me(e,t){var n="";if(e&&(n=fe.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===fe.call(e.buffer))){var r,i=Q;e instanceof ArrayBuffer?(r=e,i+=ee):(r=e.buffer,"[object Int8Array]"===n?i+=ne:"[object Uint8Array]"===n?i+=re:"[object Uint8ClampedArray]"===n?i+=ie:"[object Int16Array]"===n?i+=oe:"[object Uint16Array]"===n?i+=ae:"[object Int32Array]"===n?i+=se:"[object Uint32Array]"===n?i+=ce:"[object Float32Array]"===n?i+=ue:"[object Float64Array]"===n?i+=le:t(new Error("Failed to get type for BinaryArray"))),t(i+he(r))}else if("[object Blob]"===n){var o=new FileReader;o.onload=function(){var n=Y+e.type+"~"+he(this.result);t(Q+te+n)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(s){t(null,s)}}function _e(e){if(e.substring(0,Z)!==Q)return JSON.parse(e);var t,n=e.substring(de),r=e.substring(Z,de);if(r===te&&X.test(n)){var i=n.match(X);t=i[1],n=n.substring(i[0].length)}var o=pe(n);switch(r){case ee:return o;case te:return c([o],{type:t});case ne:return new Int8Array(o);case re:return new Uint8Array(o);case ie:return new Uint8ClampedArray(o);case oe:return new Int16Array(o);case ae:return new Uint16Array(o);case se:return new Int32Array(o);case ce:return new Uint32Array(o);case ue:return new Float32Array(o);case le:return new Float64Array(o);default:throw new Error("Unkown type: "+r)}}var ge={serialize:me,deserialize:_e,stringToBuffer:pe,bufferToString:he};function ve(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function ye(e){var t=this,n={db:null};if(e)for(var r in e)n[r]="string"!=typeof e[r]?e[r].toString():e[r];var i=new u((function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(i){return r(i)}n.db.transaction((function(i){ve(i,n,(function(){t._dbInfo=n,e()}),(function(e,t){r(t)}))}),r)}));return n.serializer=ge,i}function be(e,t,n,r,i,o){e.executeSql(n,r,i,(function(e,s){s.code===s.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,a){a.rows.length?o(e,s):ve(e,t,(function(){e.executeSql(n,r,i,o)}),o)}),o):o(e,s)}),o)}function we(e,t){var n=this;e=f(e);var r=new u((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){be(n,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=i.serializer.deserialize(r)),t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return l(r,t),r}function ke(e,t){var n=this,r=new u((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){be(n,i,"SELECT * FROM "+i.storeName,[],(function(n,r){for(var o=r.rows,s=o.length,a=0;a<s;a++){var c=o.item(a),u=c.value;if(u&&(u=i.serializer.deserialize(u)),void 0!==(u=e(u,c.key,a+1)))return void t(u)}t()}),(function(e,t){r(t)}))}))})).catch(r)}));return l(r,t),r}function Ee(e,t,n,r){var i=this;e=f(e);var o=new u((function(o,s){i.ready().then((function(){void 0===t&&(t=null);var a=t,c=i._dbInfo;c.serializer.serialize(t,(function(t,u){u?s(u):c.db.transaction((function(n){be(n,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){o(a)}),(function(e,t){s(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void o(Ee.apply(i,[e,a,n,r-1]));s(t)}}))}))})).catch(s)}));return l(o,n),o}function Se(e,t,n){return Ee.apply(this,[e,t,n,1])}function Te(e,t){var n=this;e=f(e);var r=new u((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){be(n,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){r(t)}))}))})).catch(r)}));return l(r,t),r}function Ie(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){be(t,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return l(n,e),n}function xe(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){be(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(t,n){var r=n.rows.item(0).c;e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return l(n,e),n}function Oe(e,t){var n=this,r=new u((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){be(n,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return l(r,t),r}function Ne(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){be(t,r,"SELECT key FROM "+r.storeName,[],(function(t,n){for(var r=[],i=0;i<n.rows.length;i++)r.push(n.rows.item(i).key);e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return l(n,e),n}function Ae(e){return new u((function(t,n){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var i=[],o=0;o<r.rows.length;o++)i.push(r.rows.item(o).name);t({db:e,storeNames:i})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}function Re(e,t){t=p.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,i=this;return r=e.name?new u((function(t){var r;r=e.name===n.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:r,storeNames:[e.storeName]}):t(Ae(r))})).then((function(e){return new u((function(t,n){e.db.transaction((function(r){function i(e){return new u((function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var o=[],s=0,a=e.storeNames.length;s<a;s++)o.push(i(e.storeNames[s]));u.all(o).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):u.reject("Invalid arguments"),l(r,t),r}var Le={_driver:"webSQLStorage",_initStorage:ye,_support:K(),iterate:ke,getItem:we,setItem:Se,removeItem:Te,clear:Ie,length:xe,key:Oe,keys:Ne,dropInstance:Re};function Ce(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}function Pe(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function Me(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(t){return!0}}function De(){return!Me()||localStorage.length>0}function je(e){var t=this,n={};if(e)for(var r in e)n[r]=e[r];return n.keyPrefix=Pe(e,t._defaultConfig),De()?(t._dbInfo=n,n.serializer=ge,u.resolve()):u.reject()}function Be(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return l(n,e),n}function Fe(e,t){var n=this;e=f(e);var r=n.ready().then((function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r}));return l(r,t),r}function Ue(e,t){var n=this,r=n.ready().then((function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,o=localStorage.length,s=1,a=0;a<o;a++){var c=localStorage.key(a);if(0===c.indexOf(r)){var u=localStorage.getItem(c);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,c.substring(i),s++)))return u}}}));return l(r,t),r}function Ge(e,t){var n=this,r=n.ready().then((function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch(i){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return l(r,t),r}function qe(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i<n;i++){var o=localStorage.key(i);0===o.indexOf(e.keyPrefix)&&r.push(o.substring(e.keyPrefix.length))}return r}));return l(n,e),n}function We(e){var t=this.keys().then((function(e){return e.length}));return l(t,e),t}function ze(e,t){var n=this;e=f(e);var r=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return l(r,t),r}function Ve(e,t,n){var r=this;e=f(e);var i=r.ready().then((function(){void 0===t&&(t=null);var n=t;return new u((function(i,o){var s=r._dbInfo;s.serializer.serialize(t,(function(t,r){if(r)o(r);else try{localStorage.setItem(s.keyPrefix+e,t),i(n)}catch(a){"QuotaExceededError"!==a.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==a.name||o(a),o(a)}}))}))}));return l(i,n),i}function Je(e,t){if(t=p.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r,i=this;return r=e.name?new u((function(t){e.storeName?t(Pe(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):u.reject("Invalid arguments"),l(r,t),r}var He={_driver:"localStorageWrapper",_initStorage:je,_support:Ce(),iterate:Ue,getItem:Fe,setItem:Ve,removeItem:ze,clear:Be,length:We,key:Ge,keys:qe,dropInstance:Je},Ke=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},$e=function(e,t){for(var n=e.length,r=0;r<n;){if(Ke(e[r],t))return!0;r++}return!1},Ye=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Xe={},Qe={},Ze={INDEXEDDB:H,WEBSQL:Le,LOCALSTORAGE:He},et=[Ze.INDEXEDDB._driver,Ze.WEBSQL._driver,Ze.LOCALSTORAGE._driver],tt=["dropInstance"],nt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tt),rt={description:"",driver:et.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function it(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function ot(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(Ye(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var st=function(){function e(t){for(var n in i(this,e),Ze)if(Ze.hasOwnProperty(n)){var r=Ze[n],o=r._driver;this[n]=o,Xe[o]||this.defineDriver(r)}this._defaultConfig=ot({},rt),this._config=ot({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new u((function(t,n){try{var r=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(i);for(var o=nt.concat("_initStorage"),s=0,a=o.length;s<a;s++){var c=o[s];if((!$e(tt,c)||e[c])&&"function"!=typeof e[c])return void n(i)}var d=function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=u.reject(t);return l(n,arguments[arguments.length-1]),n}},n=0,r=tt.length;n<r;n++){var i=tt[n];e[i]||(e[i]=t(i))}};d();var f=function(n){Xe[r],Xe[r]=e,Qe[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(f,n):f(!!e._support):f(!0)}catch(p){n(p)}}));return d(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=Xe[e]?u.resolve(Xe[e]):u.reject(new Error("Driver not found."));return d(r,t,n),r},e.prototype.getSerializer=function(e){var t=u.resolve(ge);return d(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return d(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;Ye(e)||(e=[e]);var i=this._getSupportedDrivers(e);function o(){r._config.driver=r.driver()}function s(e){return r._extend(e),o(),r._ready=r._initStorage(r._config),r._ready}function a(e){return function(){var t=0;function n(){for(;t<e.length;){var i=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(i).then(s).catch(n)}o();var a=new Error("No available storage method found.");return r._driverSet=u.reject(a),r._driverSet}return n()}}var c=null!==this._driverSet?this._driverSet.catch((function(){return u.resolve()})):u.resolve();return this._driverSet=c.then((function(){var e=i[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then((function(e){r._driver=e._driver,o(),r._wrapLibraryMethodsWithReady(),r._initDriver=a(i)}))})).catch((function(){o();var e=new Error("No available storage method found.");return r._driverSet=u.reject(e),r._driverSet})),d(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!Qe[e]},e.prototype._extend=function(e){ot(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=nt.length;e<t;e++)it(this,nt[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),at=new st;t.exports=at},{3:3}]},{},[4])(4)},24323:(e,t,n)=>{!function(){var t=n(65960),r=n(11036).utf8,i=n(24982),o=n(11036).bin,s=function(e,n){e.constructor==String?e=n&&"binary"===n.encoding?o.stringToBytes(e):r.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var a=t.bytesToWords(e),c=8*e.length,u=1732584193,l=-271733879,d=-1732584194,f=271733878,p=0;p<a.length;p++)a[p]=16711935&(a[p]<<8|a[p]>>>24)|4278255360&(a[p]<<24|a[p]>>>8);a[c>>>5]|=128<<c%32,a[14+(c+64>>>9<<4)]=c;var h=s._ff,m=s._gg,_=s._hh,g=s._ii;for(p=0;p<a.length;p+=16){var v=u,y=l,b=d,w=f;u=h(u,l,d,f,a[p+0],7,-680876936),f=h(f,u,l,d,a[p+1],12,-389564586),d=h(d,f,u,l,a[p+2],17,606105819),l=h(l,d,f,u,a[p+3],22,-1044525330),u=h(u,l,d,f,a[p+4],7,-176418897),f=h(f,u,l,d,a[p+5],12,1200080426),d=h(d,f,u,l,a[p+6],17,-1473231341),l=h(l,d,f,u,a[p+7],22,-45705983),u=h(u,l,d,f,a[p+8],7,1770035416),f=h(f,u,l,d,a[p+9],12,-1958414417),d=h(d,f,u,l,a[p+10],17,-42063),l=h(l,d,f,u,a[p+11],22,-1990404162),u=h(u,l,d,f,a[p+12],7,1804603682),f=h(f,u,l,d,a[p+13],12,-40341101),d=h(d,f,u,l,a[p+14],17,-1502002290),u=m(u,l=h(l,d,f,u,a[p+15],22,1236535329),d,f,a[p+1],5,-165796510),f=m(f,u,l,d,a[p+6],9,-1069501632),d=m(d,f,u,l,a[p+11],14,643717713),l=m(l,d,f,u,a[p+0],20,-373897302),u=m(u,l,d,f,a[p+5],5,-701558691),f=m(f,u,l,d,a[p+10],9,38016083),d=m(d,f,u,l,a[p+15],14,-660478335),l=m(l,d,f,u,a[p+4],20,-405537848),u=m(u,l,d,f,a[p+9],5,568446438),f=m(f,u,l,d,a[p+14],9,-1019803690),d=m(d,f,u,l,a[p+3],14,-187363961),l=m(l,d,f,u,a[p+8],20,1163531501),u=m(u,l,d,f,a[p+13],5,-1444681467),f=m(f,u,l,d,a[p+2],9,-51403784),d=m(d,f,u,l,a[p+7],14,1735328473),u=_(u,l=m(l,d,f,u,a[p+12],20,-1926607734),d,f,a[p+5],4,-378558),f=_(f,u,l,d,a[p+8],11,-2022574463),d=_(d,f,u,l,a[p+11],16,1839030562),l=_(l,d,f,u,a[p+14],23,-35309556),u=_(u,l,d,f,a[p+1],4,-1530992060),f=_(f,u,l,d,a[p+4],11,1272893353),d=_(d,f,u,l,a[p+7],16,-155497632),l=_(l,d,f,u,a[p+10],23,-1094730640),u=_(u,l,d,f,a[p+13],4,681279174),f=_(f,u,l,d,a[p+0],11,-358537222),d=_(d,f,u,l,a[p+3],16,-722521979),l=_(l,d,f,u,a[p+6],23,76029189),u=_(u,l,d,f,a[p+9],4,-640364487),f=_(f,u,l,d,a[p+12],11,-421815835),d=_(d,f,u,l,a[p+15],16,530742520),u=g(u,l=_(l,d,f,u,a[p+2],23,-995338651),d,f,a[p+0],6,-198630844),f=g(f,u,l,d,a[p+7],10,1126891415),d=g(d,f,u,l,a[p+14],15,-1416354905),l=g(l,d,f,u,a[p+5],21,-57434055),u=g(u,l,d,f,a[p+12],6,1700485571),f=g(f,u,l,d,a[p+3],10,-1894986606),d=g(d,f,u,l,a[p+10],15,-1051523),l=g(l,d,f,u,a[p+1],21,-2054922799),u=g(u,l,d,f,a[p+8],6,1873313359),f=g(f,u,l,d,a[p+15],10,-30611744),d=g(d,f,u,l,a[p+6],15,-1560198380),l=g(l,d,f,u,a[p+13],21,1309151649),u=g(u,l,d,f,a[p+4],6,-145523070),f=g(f,u,l,d,a[p+11],10,-1120210379),d=g(d,f,u,l,a[p+2],15,718787259),l=g(l,d,f,u,a[p+9],21,-343485551),u=u+v>>>0,l=l+y>>>0,d=d+b>>>0,f=f+w>>>0}return t.endian([u,l,d,f])};s._ff=function(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+(i>>>0)+s;return(a<<o|a>>>32-o)+t},s._gg=function(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+(i>>>0)+s;return(a<<o|a>>>32-o)+t},s._hh=function(e,t,n,r,i,o,s){var a=e+(t^n^r)+(i>>>0)+s;return(a<<o|a>>>32-o)+t},s._ii=function(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+(i>>>0)+s;return(a<<o|a>>>32-o)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(s(e,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):t.bytesToHex(r)}}()},18430:(e,t)=>{var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,_={};function g(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}function v(){}function y(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=g.prototype;var b=y.prototype=new v;b.constructor=y,m(b,g.prototype),b.isPureReactComponent=!0;var w=Array.isArray,k=Object.prototype.hasOwnProperty,E={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function T(e,t,r){var i,o={},s=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(s=""+t.key),t)k.call(t,i)&&!S.hasOwnProperty(i)&&(o[i]=t[i]);var c=arguments.length-2;if(1===c)o.children=r;else if(1<c){for(var u=Array(c),l=0;l<c;l++)u[l]=arguments[l+2];o.children=u}if(e&&e.defaultProps)for(i in c=e.defaultProps)void 0===o[i]&&(o[i]=c[i]);return{$$typeof:n,type:e,key:s,ref:a,props:o,_owner:E.current}}function I(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var x=/\/+/g;function O(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function N(e,t,i,o,s){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var c=!1;if(null===e)c=!0;else switch(a){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case n:case r:c=!0}}if(c)return s=s(c=e),e=""===o?"."+O(c,0):o,w(s)?(i="",null!=e&&(i=e.replace(x,"$&/")+"/"),N(s,t,i,"",(function(e){return e}))):null!=s&&(I(s)&&(s=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(s,i+(!s.key||c&&c.key===s.key?"":(""+s.key).replace(x,"$&/")+"/")+e)),t.push(s)),1;if(c=0,o=""===o?".":o+":",w(e))for(var u=0;u<e.length;u++){var l=o+O(a=e[u],u);c+=N(a,t,i,l,s)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),u=0;!(a=e.next()).done;)c+=N(a=a.value,t,i,l=o+O(a,u++),s);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return c}function A(e,t,n){if(null==e)return e;var r=[],i=0;return N(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function R(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var L={current:null},C={transition:null},P={ReactCurrentDispatcher:L,ReactCurrentBatchConfig:C,ReactCurrentOwner:E};t.Children={map:A,forEach:function(e,t,n){A(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return A(e,(function(){t++})),t},toArray:function(e){return A(e,(function(e){return e}))||[]},only:function(e){if(!I(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=g,t.Fragment=i,t.Profiler=s,t.PureComponent=y,t.StrictMode=o,t.Suspense=l,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=m({},e.props),o=e.key,s=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,a=E.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)k.call(t,u)&&!S.hasOwnProperty(u)&&(i[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)i.children=r;else if(1<u){c=Array(u);for(var l=0;l<u;l++)c[l]=arguments[l+2];i.children=c}return{$$typeof:n,type:e.type,key:o,ref:s,props:i,_owner:a}},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=T,t.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=I,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:R}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=C.transition;C.transition={};try{e()}finally{C.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return L.current.useCallback(e,t)},t.useContext=function(e){return L.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return L.current.useDeferredValue(e)},t.useEffect=function(e,t){return L.current.useEffect(e,t)},t.useId=function(){return L.current.useId()},t.useImperativeHandle=function(e,t,n){return L.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return L.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return L.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return L.current.useMemo(e,t)},t.useReducer=function(e,t,n){return L.current.useReducer(e,t,n)},t.useRef=function(e){return L.current.useRef(e)},t.useState=function(e){return L.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return L.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return L.current.useTransition()},t.version="18.2.0"},11855:(e,t,n)=>{e.exports=n(18430)},64143:(e,t,n)=>{var r=n(11855);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,s=r.useEffect,a=r.useLayoutEffect,c=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(r){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return a((function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})}),[e,n,t]),s((function(){return u(i)&&l({inst:i}),e((function(){u(i)&&l({inst:i})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},42740:(e,t,n)=>{var r=n(11855),i=n(86488);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=i.useSyncExternalStore,a=r.useRef,c=r.useEffect,u=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=u((function(){function e(e){if(!c){if(c=!0,s=e,e=r(e),void 0!==i&&f.hasValue){var t=f.value;if(i(t,e))return a=t}return a=e}if(t=a,o(s,e))return t;var n=r(e);return void 0!==i&&i(t,n)?t:(s=e,a=n)}var s,a,c=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,i]);var p=s(e,d[0],d[1]);return c((function(){f.hasValue=!0,f.value=p}),[p]),l(p),p}},86488:(e,t,n)=>{e.exports=n(64143)},53954:(e,t,n)=>{e.exports=n(42740)},86152:function(e,t,n){!function(e){function t(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{c(r.next(e))}catch(t){o(t)}}function a(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){e.done?n(e.value):i(e.value).then(s,a)}c((r=r.apply(e,t||[])).next())}))}let r="";function i(e=""){return`02${Date.now()}`+(r||(r=u(e)))+Math.random().toString(16).slice(-6)}function o(){return 1e4*Date.now()+Math.floor(1e4*Math.random())}function s(e){return(Array(8).join("0")+parseInt(e,10).toString(2)).slice(-8)}function a(e){return(Array(4).join("0")+parseInt(e,2).toString(16)).slice(-4)}function c(e){const t=e.split(/\./).map((e=>s(e))),n=[];return n[0]=a(t[0]+t[1]),n[1]=a(t[2]+t[3]),["0000","0000","0000","0000","0000","ffff",n[0],n[1]].join("")}function u(e){const t=/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/.test(e),n=/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/.test(e);return t?c(e):n?l(e):"00000000000000000000000000000000"}function l(e){let t="";const n=[];let r=0,i=0,o=!0;const s="0000";if(e.indexOf("::")>-1){const a=e.split("::");for(let e=0;e<a.length;e++){const t=a[e];if(t.indexOf(":")>0){const e=t.split(":");o&&(r=e.length),i+=e.length;for(let t=0;t<e.length;t++)if(4!==e[t].length){const r=s.substring(0,4-e[t].length).concat(e[t]);n.push(r)}else n.push(e[t]);o=!1}else{if(4!==t.length){const e=s.substring(0,4-t.length).concat(t);n.push(e)}else n.push(t);o&&(r+=1),i+=1,o=!1}}let c="";for(let e=0;e<8-i;e++)c=c.concat(s);for(let e=0;e<n.length;e++)e===r?(t=t.concat(c),t=t.concat(n[e])):t=t.concat(n[e]);return t}{const n=e.split(":");for(let e=0;e<n.length;e++){const r=n[e];if(4!==n[e].length){const i=s.substring(0,4-n[e].length).concat(r);t=t.concat(i)}else t=t.concat(r)}return t}}function d(e,t){const n=e.key;void 0!==n&&(j(t,10),L(t,n));const r=e.value;void 0!==r&&(j(t,18),L(t,r))}function f(e){const t={};e:for(;!I(e);){const n=D(e);switch(n>>>3){case 0:break e;case 1:t.key=R(e,D(e));break;case 2:t.value=R(e,D(e));break;default:v(e,7&n)}}if(void 0===t.key)throw new Error("Missing required field: key");if(void 0===t.value)throw new Error("Missing required field: value");return t}function p(e){const t=w();return h(e,t),S(t)}function h(e,t){const n=e.SeqID;void 0!==n&&(j(t,8),F(t,n));const r=e.LogID;void 0!==r&&(j(t,16),F(t,r));const i=e.service;void 0!==i&&(j(t,24),F(t,y(i)));const o=e.method;void 0!==o&&(j(t,32),F(t,y(o)));const s=e.headers;if(void 0!==s)for(const f of s){j(t,42);const e=w();d(f,e),j(t,e.limit),C(t,e),k(e)}const a=e.payloadEncoding;void 0!==a&&(j(t,50),L(t,a));const c=e.payloadType;void 0!==c&&(j(t,58),L(t,c));const u=e.payload;void 0!==u&&(j(t,66),j(t,u.length),A(t,u));const l=e.LogIDNew;void 0!==l&&(j(t,74),L(t,l))}function m(e){return _(E(e))}function _(e){const t={};e:for(;!I(e);){const n=D(e);switch(n>>>3){case 0:break e;case 1:t.SeqID=B(e,!0);break;case 2:t.LogID=B(e,!0);break;case 3:t.service=D(e);break;case 4:t.method=D(e);break;case 5:{const n=g(e);(t.headers||(t.headers=[])).push(f(e)),e.limit=n;break}case 6:t.payloadEncoding=R(e,D(e));break;case 7:t.payloadType=R(e,D(e));break;case 8:t.payload=N(e,D(e));break;case 9:t.LogIDNew=R(e,D(e));break;default:v(e,7&n)}}if(void 0===t.SeqID)throw new Error("Missing required field: SeqID");if(void 0===t.LogID)throw new Error("Missing required field: LogID");if(void 0===t.service)throw new Error("Missing required field: service");if(void 0===t.method)throw new Error("Missing required field: method");return t}function g(e){const t=D(e),n=e.limit;return e.limit=e.offset+t,n}function v(e,t){switch(t){case 0:for(;128&P(e););break;case 2:T(e,D(e));break;case 5:T(e,4);break;case 1:T(e,8);break;default:throw new Error("Unimplemented type: "+t)}}function y(e){return{low:e|=0,high:e>>31,unsigned:e>=0}}const b=[];function w(){const e=b.pop();return e?(e.offset=e.limit=0,e):{bytes:new Uint8Array(64),offset:0,limit:0}}function k(e){b.push(e)}function E(e){return{bytes:e,offset:0,limit:e.length}}function S(e){const t=e.bytes,n=e.limit;return t.length===n?t:t.subarray(0,n)}function T(e,t){if(e.offset+t>e.limit)throw new Error("Skip past limit");e.offset+=t}function I(e){return e.offset>=e.limit}function x(e,t){const n=e.bytes,r=e.offset,i=e.limit,o=r+t;if(o>n.length){const t=new Uint8Array(2*o);t.set(n),e.bytes=t}return e.offset=o,o>i&&(e.limit=o),r}function O(e,t){const n=e.offset;if(n+t>e.limit)throw new Error("Read past limit");return e.offset+=t,n}function N(e,t){const n=O(e,t);return e.bytes.subarray(n,n+t)}function A(e,t){const n=x(e,t.length);e.bytes.set(t,n)}function R(e,t){const n=O(e,t),r=String.fromCharCode,i=e.bytes,o="\ufffd";let s="";for(let a=0;a<t;a++){const e=i[a+n];let c,u,l,d;128&e?192==(224&e)?a+1>=t?s+=o:(c=i[a+n+1],128!=(192&c)?s+=o:(d=(31&e)<<6|63&c,d<128?s+=o:(s+=r(d),a++))):224==(240&e)?a+2>=t?s+=o:(c=i[a+n+1],u=i[a+n+2],32896!=(49344&(c|u<<8))?s+=o:(d=(15&e)<<12|(63&c)<<6|63&u,d<2048||d>=55296&&d<=57343?s+=o:(s+=r(d),a+=2))):240==(248&e)?a+3>=t?s+=o:(c=i[a+n+1],u=i[a+n+2],l=i[a+n+3],8421504!=(12632256&(c|u<<8|l<<16))?s+=o:(d=(7&e)<<18|(63&c)<<12|(63&u)<<6|63&l,d<65536||d>1114111?s+=o:(d-=65536,s+=r(55296+(d>>10),56320+(1023&d)),a+=3))):s+=o:s+=r(e)}return s}function L(e,t){const n=t.length;let r=0;for(let s=0;s<n;s++){let e=t.charCodeAt(s);e>=55296&&e<=56319&&s+1<n&&(e=(e<<10)+t.charCodeAt(++s)-56613888),r+=e<128?1:e<2048?2:e<65536?3:4}j(e,r);let i=x(e,r);const o=e.bytes;for(let s=0;s<n;s++){let e=t.charCodeAt(s);e>=55296&&e<=56319&&s+1<n&&(e=(e<<10)+t.charCodeAt(++s)-56613888),e<128?o[i++]=e:(e<2048?o[i++]=e>>6&31|192:(e<65536?o[i++]=e>>12&15|224:(o[i++]=e>>18&7|240,o[i++]=e>>12&63|128),o[i++]=e>>6&63|128),o[i++]=63&e|128)}}function C(e,t){const n=x(e,t.limit),r=e.bytes,i=t.bytes;for(let o=0,s=t.limit;o<s;o++)r[o+n]=i[o]}function P(e){return e.bytes[O(e,1)]}function M(e,t){const n=x(e,1);e.bytes[n]=t}function D(e){let t,n=0,r=0;do{t=P(e),n<32&&(r|=(127&t)<<n),n+=7}while(128&t);return r}function j(e,t){for(t>>>=0;t>=128;)M(e,127&t|128),t>>>=7;M(e,t)}function B(e,t){let n,r=0,i=0,o=0;return n=P(e),r=127&n,128&n&&(n=P(e),r|=(127&n)<<7,128&n&&(n=P(e),r|=(127&n)<<14,128&n&&(n=P(e),r|=(127&n)<<21,128&n&&(n=P(e),i=127&n,128&n&&(n=P(e),i|=(127&n)<<7,128&n&&(n=P(e),i|=(127&n)<<14,128&n&&(n=P(e),i|=(127&n)<<21,128&n&&(n=P(e),o=127&n,128&n&&(n=P(e),o|=(127&n)<<7))))))))),{low:r|i<<28,high:i>>>4|o<<24,unsigned:t}}function F(e,t){const n=t.low>>>0,r=(t.low>>>28|t.high<<4)>>>0,i=t.high>>>24,o=0===i?0===r?n<16384?n<128?1:2:n<1<<21?3:4:r<16384?r<128?5:6:r<1<<21?7:8:i<128?9:10,s=x(e,o),a=e.bytes;switch(o){case 10:a[s+9]=i>>>7&1;case 9:a[s+8]=9!==o?128|i:127&i;case 8:a[s+7]=8!==o?r>>>21|128:r>>>21&127;case 7:a[s+6]=7!==o?r>>>14|128:r>>>14&127;case 6:a[s+5]=6!==o?r>>>7|128:r>>>7&127;case 5:a[s+4]=5!==o?128|r:127&r;case 4:a[s+3]=4!==o?n>>>21|128:n>>>21&127;case 3:a[s+2]=3!==o?n>>>14|128:n>>>14&127;case 2:a[s+1]=2!==o?n>>>7|128:n>>>7&127;case 1:a[s]=1!==o?128|n:127&n}}function U(e){return m(e)}function G(e){return p(e)}const q=65536,W="\0\0\0\0\0\0\0\0",z=q*q,V=z*z,J=V/2,H=String.prototype.charCodeAt;class K{constructor(e,t,n){this.isLong=!0,this.low=0|e,this.high=0|t,this.unsigned=!!n}static isLong(e){return e&&!0===e.isLong}static fromBits(e,t,n){return new K(e,t,n)}static fromBytes(e,t,n){return n?K.fromBytesLE(e,t):K.fromBytesBE(e,t)}static fromBytesLE(e,t){return new K(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)}static fromBytesBE(e,t){return new K(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}static fromHash(e){return e===W?$:new K((H.call(e,0)|H.call(e,1)<<8|H.call(e,2)<<16|H.call(e,3)<<24)>>>0,(H.call(e,4)|H.call(e,5)<<8|H.call(e,6)<<16|H.call(e,7)<<24)>>>0,!0)}toHash(){return String.fromCharCode(255&this.low,this.low>>>8&255,this.low>>>16&255,this.low>>>24,255&this.high,this.high>>>8&255,this.high>>>16&255,this.high>>>24)}static fromNumber(e,t=!0){if(isNaN(e))return t?Y:$;if(t){if(e>=V)return Q}else{if(e<=-J)return Z;if(e+1>=J)return X}return K.fromBits(e%z|0,e/z|0,t)}toNumber(){return this.unsigned?(this.high>>>0)*z+(this.low>>>0):this.high*z+(this.low>>>0)}isZero(){return 0===this.high&&0===this.low}add(e){K.isLong(e)||(e=K.fromNumber(e));const t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,o=e.high>>>16,s=65535&e.high,a=e.low>>>16;let c=0,u=0,l=0,d=0;return d+=i+(65535&e.low),l+=d>>>16,d&=65535,l+=r+a,u+=l>>>16,l&=65535,u+=n+s,c+=u>>>16,u&=65535,c+=t+o,c&=65535,K.fromBits(l<<16|d,c<<16|u,this.unsigned)}equals(e){return K.isLong(e)||(e=K.fromNumber(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low}addOne(){return-1===this.low&&-1===this.high?K.fromBits(0,0,this.unsigned):-1===this.low?K.fromBits(0,this.high+1,this.unsigned):K.fromBits(this.low+1,this.high,this.unsigned)}toBytes(e){return e?this.toBytesLE():this.toBytesBE()}toBytesLE(){const e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]}toBytesBE(){const e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]}}const $=new K(0,0,!1),Y=new K(0,0,!0),X=K.fromBits(-1,2147483647,!1),Q=K.fromBits(-1,-1,!0),Z=K.fromBits(0,-2147483648,!1);e.ErrorCode=void 0,function(e){e[e.NATIVE_ERROR=5001]="NATIVE_ERROR",e[e.CONNECTING_ERROR=5002]="CONNECTING_ERROR",e[e.MAX_RETRIES_ERROR=5003]="MAX_RETRIES_ERROR",e[e.MESSAGE_ERROR=5004]="MESSAGE_ERROR",e[e.OPEN_ERROR=5005]="OPEN_ERROR"}(e.ErrorCode||(e.ErrorCode={}));class ee{constructor(e){this.type=e,this.target=null}}class te extends ee{constructor(e,t){super(e),this.message=t&&t.message||null}}class ne extends ee{constructor(t,n){super(t),this.error=n&&n.error||null,this.colno=n&&n.colno||0,this.filename=n&&n.filename||"",this.lineno=n&&n.lineno||0,this.message=n&&n.message||"",this.code=n&&n.code||e.ErrorCode.NATIVE_ERROR}}class re extends ee{constructor(e,t){super(e),this.code=t&&t.code||0,this.reason=t&&t.reason||"",this.wasClean=t&&t.wasClean||!1,this.willReconnect=t&&t.willReconnect||!1}}class ie extends ee{constructor(e,t){super(e),this.data=t&&t.data||null}}class oe extends ie{constructor(e,t){super(e),this.data=t&&t.data||null,this.message=t&&t.message||null}}class se extends ee{constructor(e,t){super(e),this.data=t&&t.data||null}}function ae(e,{message:t,code:n}){return new ne(e,{message:t,code:n})}function ce(e,{code:t,reason:n,wasClean:r,willReconnect:i}){return new re(e,{code:t,reason:n,wasClean:r,willReconnect:i})}function ue(e,{data:t,message:n}){return new oe(e,{data:t,message:n})}function le(e,{data:t}){return new se(e,{data:t})}function de(e,{message:t}){return new te(e,{message:t})}class fe{constructor(e,t){this.endpoints=e,this.maxRetries=t,this.currentIndex=0,this.currentEndpointTriesCount=0}resetEndpointConfig(){this.currentIndex=0,this.currentEndpointTriesCount=0}resetTries(){this.currentEndpointTriesCount=0}getCurrentEndpoint(){return this.endpoints[this.currentIndex]}getCurrentEndpointTriesCount(){return this.currentEndpointTriesCount}checkReachMaxTries(){return this.currentIndex>=this.endpoints.length||this.currentIndex===this.endpoints.length-1&&this.currentEndpointTriesCount===this.maxRetries}checkCurrentEndpointReachedMaxRetries(){return this.currentIndex==this.endpoints.length||this.currentEndpointTriesCount>this.maxRetries}replaceBackupEndpointAndUpdateCount(){return this.currentEndpointTriesCount=1,this.currentIndex++,this.endpoints[this.currentIndex]}getCurrentEndpointAndUpdateCount(){return this.currentEndpointTriesCount++,this.getCurrentEndpoint()}}const pe=("undefined"!=typeof globalThis&&"Window"===globalThis.constructor.name||"undefined"!=typeof window&&"Window"===window.constructor.name)&&"undefined"!=typeof document,he="undefined"!=typeof globalThis&&("Object"===globalThis.constructor.name||"DedicatedWorkerGlobalScope"===globalThis.constructor.name)&&"undefined"!=typeof tt,me=("undefined"!=typeof globalThis&&"Object"===globalThis.constructor.name||"undefined"==typeof globalThis||"undefined"!=typeof globalThis&&!!globalThis.WeixinJSBridge)&&"undefined"!=typeof wx,_e="undefined"!=typeof globalThis&&("DedicatedWorkerGlobalScope"===globalThis.constructor.name||"SharedWorkerGlobalScope"===globalThis.constructor.name||"ServiceWorkerGlobalScope"===globalThis.constructor.name)&&"undefined"!=typeof self,ge="undefined"!=typeof globalThis&&"Object"===globalThis.constructor.name&&"Object"===n.g.constructor.name&&"undefined"!=typeof process&&process.version;class ve{constructor(){this._listeners={}}emit(e,...t){const n=this._listeners[e];if(n)n.slice().forEach((e=>e.fn.apply(e.ctx,t)));else if("error"===e&&!this.onerror){const e=t.length&&t[0];if(e instanceof Error)throw e;throw new Error("Unhandled error."+(e?" ("+e.message+")":"")).context=e,e}return this}off(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=null;else{const n=this._listeners[e];if(n)for(let e=0;e<n.length;)n[e].fn===t?n.splice(e,1):++e}return this}on(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this}}class ye extends ve{constructor(e,t,n){super(),this._socket=null,me&&wx.connectSocket&&(this._socket=wx.connectSocket({url:e,protocols:t,header:n,fail:this._createSocketFailHandler.bind(this),success:this._createSocketSuccessHandler.bind(this)})),he&&tt.connectSocket&&(this._socket=tt.connectSocket({url:e,protocols:t,header:n,fail:this._createSocketFailHandler.bind(this),success:this._createSocketSuccessHandler.bind(this)}))}_createSocketSuccessHandler(){Promise.resolve().then((()=>{this._addWsListeners()}))}_createSocketFailHandler(e){Promise.resolve().then((()=>{const t=ae("error",{message:e.errMsg||e.errNo?`message: ${e.errMsg}`||`code: ${e.errNo}`||"":JSON.stringify(e)});this.emit("error",t);const n=ce("close",{reason:e.errMsg||e.errNo?`message: ${e.errMsg}`||`code: ${e.errNo}`||"":JSON.stringify(e)});this.emit("close",n)}))}_addWsListeners(){this._socket.onOpen((e=>{this.emit("open",le("open",Object.assign(Object.assign({},e),{data:e.errMsg||""})))})),this._socket.onClose((e=>{this.emit("close",ce("close",Object.assign({},e)))})),this._socket.onMessage((e=>{this.emit("message",ue("message",Object.assign({},e)))})),this._socket.onError((e=>{this.emit("error",ae("error",Object.assign(Object.assign({},e),{message:e.errMsg||""})))}))}send(e){if(e instanceof Uint8Array){const t=e.buffer.slice(e.byteOffset,e.byteLength+e.byteOffset);this._socket&&this._socket.send({data:t,fail:e=>{this.emit("error",ae("error",{message:e.errMsg||e.errNo?`message: ${e.errMsg}`||`code: ${e.errNo}`||"":JSON.stringify(e)}))}})}else this._socket&&this._socket.send({data:e,fail:e=>{this.emit("error",ae("error",{message:e.errMsg||e.errNo?`message: ${e.errMsg}`||`code: ${e.errNo}`||"":JSON.stringify(e)}))}})}close(e,t){this._socket&&this._socket.close({code:e,reason:t})}addEventListener(e,t){this.on(e,t)}removeEventListener(e,t){this.off(e,t)}get readyState(){return this._socket.readyState}get binaryType(){return this._socket.binaryType}set binaryType(e){}get url(){return this._socket.url}get protocol(){return this._socket.protocol}get extensions(){return this._socket.extensions}get bufferedAmount(){return 0}}function be(e,t){return t?new t(e.url,e.protocol):me||he?new ye(e.url,e.protocol,e.headers):(pe||_e)&&"undefined"!=typeof WebSocket&&WebSocket?new WebSocket(e.url,e.protocols):void 0}function we(e){return!!(e||me&&wx.connectSocket||he&&tt.connectSocket||(pe||_e)&&"undefined"!=typeof WebSocket&&WebSocket)}function ke(e,t,n){return!!(null==e?void 0:e.find((e=>e.key===t&&e.value===n)))}function Ee(e,t){var n;return null===(n=null==e?void 0:e.find((e=>e.key===t)))||void 0===n?void 0:n.value}function Se(e){return t(this,void 0,void 0,(function*(){const{enableAutoAck:t}=this._options,n=ke(e.message.headers,"need_ack","1"),r=ke(e.message.headers,"is_ack","1"),i=ke(e.message.headers,"x_frontier_qos_ack","1");if(t&&n){const{SeqID:t,LogID:n,service:r,LogIDNew:i,method:o}=e.message;this._sendAck({SeqID:t,LogID:n,LogIDNew:i,service:r,method:o,headers:[{key:"is_ack",value:"1"},{key:"ack_id",value:i||""},{key:"ack_code",value:"0"}]})}r&&!i&&this._dispatchAckMessageEvent(e)}))}function Te(e){let t=0,n=0;for(let r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t}function Ie(e,t,n){if(n-t<1)return"";let r="";for(let i=t;i<n;){const t=e[i++];if(t<=127)r+=String.fromCharCode(t);else if(t>=192&&t<224)r+=String.fromCharCode((31&t)<<6|63&e[i++]);else if(t>=224&&t<240)r+=String.fromCharCode((15&t)<<12|(63&e[i++])<<6|63&e[i++]);else if(t>=240){const n=((7&t)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536;r+=String.fromCharCode(55296+(n>>10)),r+=String.fromCharCode(56320+(1023&n))}}return r}function xe(e,t,n){const r=n;let i,o;for(let s=0;s<e.length;++s)i=e.charCodeAt(s),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&56320==(64512&(o=e.charCodeAt(s+1)))?(i=65536+((1023&i)<<10)+(1023&o),++s,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128);return n-r}function Oe(e){return t(this,void 0,void 0,(function*(){if("string"==typeof e){const t=new Uint8Array(Te(e));return xe(e,t,0),t}return e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}))}function Ne(e){return t(this,void 0,void 0,(function*(){const t=U(yield Oe(e.data));try{if(t.payload instanceof Uint8Array){const e=this._options.payloadEncoding instanceof Object?{force:!!this._options.payloadEncoding.force,encoding:this._options.payloadEncoding.encoding?this._options.payloadEncoding.encoding.replace(/\s/g,"").toLowerCase():""}:{force:!1,encoding:this._options.payloadEncoding?this._options.payloadEncoding.replace(/\s/g,"").toLowerCase():""},n=t.payloadEncoding?t.payloadEncoding.replace(/\s/g,"").toLowerCase():"",r=this._options.payloadType instanceof Object?{force:!!this._options.payloadType.force,type:this._options.payloadType.type?this._options.payloadType.type.replace(/\s/g,"").toLowerCase():""}:{force:!1,type:this._options.payloadType?this._options.payloadType.replace(/\s/g,"").toLowerCase():""},i=t.payloadType?t.payloadType.replace(/\s/g,"").toLowerCase():"",o=r.force?r.type:i||r.type,s=e.force?e.encoding:n||e.encoding,a=["text/plain;charset=utf-8","application/json","application/json;charset=utf-8","string"],c=["none_none","binary"];this._options.enableTransformTextPayload&&a.includes(o)&&(!s||c.includes(s))?t.textPayload=Ie(t.payload,0,t.payload.byteLength):t.textPayload=""}else t.textPayload=""}catch(n){t.textPayload=""}e.message=t}))}function Ae(e,t,n){let r=-1;function i(t){return r++,r<n.length?n[r].bind(e)(t).then((()=>i(t))):Promise.resolve()}return i(t)}const Re=(e,t)=>t.some((t=>e instanceof t));let Le,Ce;function Pe(){return Le||(Le=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Me(){return Ce||(Ce=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const De=new WeakMap,je=new WeakMap,Be=new WeakMap,Fe=new WeakMap,Ue=new WeakMap;function Ge(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(He(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",o)}));return t.then((t=>{t instanceof IDBCursor&&De.set(t,e)})).catch((()=>{})),Ue.set(t,e),t}function qe(e){if(je.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)}));je.set(e,t)}let We={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return je.get(e);if("objectStoreNames"===t)return e.objectStoreNames||Be.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return He(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function ze(e){We=e(We)}function Ve(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?Me().includes(e)?function(...t){return e.apply(Ke(this),t),He(De.get(this))}:function(...t){return He(e.apply(Ke(this),t))}:function(t,...n){const r=e.call(Ke(this),t,...n);return Be.set(r,t.sort?t.sort():[t]),He(r)}}function Je(e){return"function"==typeof e?Ve(e):(e instanceof IDBTransaction&&qe(e),Re(e,Pe())?new Proxy(e,We):e)}function He(e){if(e instanceof IDBRequest)return Ge(e);if(Fe.has(e))return Fe.get(e);const t=Je(e);return t!==e&&(Fe.set(e,t),Ue.set(t,e)),t}const Ke=e=>Ue.get(e);function $e(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=He(s);return r&&s.addEventListener("upgradeneeded",(e=>{r(He(s.result),e.oldVersion,e.newVersion,He(s.transaction))})),n&&s.addEventListener("blocked",(()=>n())),a.then((e=>{o&&e.addEventListener("close",(()=>o())),i&&e.addEventListener("versionchange",(()=>i()))})).catch((()=>{})),a}const Ye=["get","getKey","getAll","getAllKeys","count"],Xe=["put","add","delete","clear"],Qe=new Map;function Ze(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Qe.get(t))return Qe.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=Xe.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!Ye.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let s=o.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),i&&o.done]))[0]};return Qe.set(t,o),o}ze((e=>({...e,get:(t,n,r)=>Ze(t,n)||e.get(t,n,r),has:(t,n)=>!!Ze(t,n)||e.has(t,n)})));class et extends ve{constructor(){super(),this._qosDB=void 0,this._intervalTimeoutId=null,this._interval=36e5,this._init()}openDB(){return t(this,void 0,void 0,(function*(){yield this._init()}))}_init(){return t(this,void 0,void 0,(function*(){return new Promise((e=>{this._qosDB?e(this):($e("frontier",1,{upgrade(e,t,n,r){e.createObjectStore("qos",{keyPath:"message_id"})}}).then((e=>{this._qosDB=e,this._intervalFlush(),this.emit("ready")})),this.on("ready",(()=>{e(this),this.off()})))}))}))}_intervalFlush(){return t(this,void 0,void 0,(function*(){clearInterval(this._intervalTimeoutId),this._intervalTimeoutId=setInterval((()=>{this.flushExpired()}),this._interval)}))}get(e){var n;return t(this,void 0,void 0,(function*(){return yield null===(n=this._qosDB)||void 0===n?void 0:n.get("qos",e)}))}set(e,n){var r;return t(this,void 0,void 0,(function*(){return yield null===(r=this._qosDB)||void 0===r?void 0:r.put("qos",{message_id:e,timestamp:n})}))}del(e){var n;return t(this,void 0,void 0,(function*(){return yield null===(n=this._qosDB)||void 0===n?void 0:n.delete("qos",e)}))}clear(){var e;return t(this,void 0,void 0,(function*(){return yield null===(e=this._qosDB)||void 0===e?void 0:e.clear("qos")}))}keys(){var e;return t(this,void 0,void 0,(function*(){return yield null===(e=this._qosDB)||void 0===e?void 0:e.getAllKeys("qos")}))}getAll(){var e;return t(this,void 0,void 0,(function*(){return yield null===(e=this._qosDB)||void 0===e?void 0:e.getAll("qos")}))}flushExpired(){var e;return t(this,void 0,void 0,(function*(){((yield null===(e=this._qosDB)||void 0===e?void 0:e.getAll("qos"))||[]).filter((({timestamp:e})=>e<Date.now())).forEach((e=>{var t;null===(t=this._qosDB)||void 0===t||t.delete("qos",e.message_id)}))}))}closeDB(){var e;return t(this,void 0,void 0,(function*(){clearInterval(this._intervalTimeoutId),null===(e=this._qosDB)||void 0===e||e.close(),this._qosDB=void 0}))}get isReady(){return this._qosDB}}class nt{constructor(){this._qosDB=localStorage,this._intervalTimeoutId=null,this._interval=36e5,this._intervalFlush()}openDB(){return t(this,void 0,void 0,(function*(){if(!this._intervalTimeoutId)return this._intervalFlush(),this}))}_intervalFlush(){return t(this,void 0,void 0,(function*(){clearInterval(this._intervalTimeoutId),this._intervalTimeoutId=setInterval((()=>{this.flushExpired()}),this._interval)}))}_add_prefix(e){return`${this._prefix}${e}`}get _prefix(){return"frontier_qos_msg_id_"}get(e){return t(this,void 0,void 0,(function*(){const t=this._qosDB.getItem(this._add_prefix(e));return JSON.parse(t||"{}")}))}set(e,n){return t(this,void 0,void 0,(function*(){return this._qosDB.setItem(this._add_prefix(e),JSON.stringify({message_id:e,timestamp:n}))}))}del(e){return t(this,void 0,void 0,(function*(){return this._qosDB.removeItem(this._add_prefix(e))}))}clear(){return t(this,void 0,void 0,(function*(){return this._qosDB.clear()}))}keys(){return t(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this._qosDB.length;t++)e.push(this._qosDB.key(t));return e.filter((e=>null==e?void 0:e.startsWith(this._prefix)))}))}getAll(){return t(this,void 0,void 0,(function*(){const e=[],t=yield this.keys();for(const n in t){const t=this._qosDB.getItem(n);e.push(JSON.parse(t||"{}"))}return e}))}flushExpired(){return t(this,void 0,void 0,(function*(){((yield this.getAll())||[]).filter((({timestamp:e})=>e<Date.now())).forEach((e=>{this.del(e.message_id)}))}))}closeDB(){clearInterval(this._intervalTimeoutId)}get isReady(){return this._qosDB}}class rt{constructor(){this._qosDB=he?tt:me?wx:null,this._intervalTimeoutId=null,this._interval=36e5,this._intervalFlush()}openDB(){return t(this,void 0,void 0,(function*(){if(!this._intervalTimeoutId)return this._intervalFlush(),this}))}_intervalFlush(){return t(this,void 0,void 0,(function*(){clearInterval(this._intervalTimeoutId),this._intervalTimeoutId=setInterval((()=>{this.flushExpired()}),this._interval)}))}_add_prefix(e){return`${this._prefix}${e}`}get _prefix(){return"frontier_qos_msg_id_"}get(e){return t(this,void 0,void 0,(function*(){const t=this._qosDB.getStorageSync(this._add_prefix(e));return JSON.parse(t||"{}")}))}set(e,n){return t(this,void 0,void 0,(function*(){return this._qosDB.setStorageSync(this._add_prefix(e),JSON.stringify({message_id:e,timestamp:n}))}))}del(e){return t(this,void 0,void 0,(function*(){return this._qosDB.removeStorageSync(this._add_prefix(e))}))}clear(){return t(this,void 0,void 0,(function*(){return this._qosDB.clearStorageSync()}))}keys(){return t(this,void 0,void 0,(function*(){const{keys:e}=this._qosDB.getStorageInfoSync();return e.filter((e=>null==e?void 0:e.startsWith(this._prefix)))}))}getAll(){return t(this,void 0,void 0,(function*(){const e=[],t=yield this.keys();for(const n of t){const t=yield this.get(n);e.push(t)}return e}))}flushExpired(){return t(this,void 0,void 0,(function*(){((yield this.getAll())||[]).filter((({timestamp:e})=>e<Date.now())).forEach((e=>{this.del(e.message_id)}))}))}closeDB(){clearInterval(this._intervalTimeoutId)}get isReady(){return this._qosDB}}function it(){return he||he?new rt:(pe||_e)&&void 0!==typeof indexedDB?new et:(pe||_e)&&void 0!==typeof localStorage?new nt:null}function ot(e){var n,r,i,o;return t(this,void 0,void 0,(function*(){const t=ke(e.message.headers,"code","-1"),s=ke(e.message.headers,"is_ack","1"),a=Ee(e.message.headers,"x_frontier_msgid"),c=Number(Ee(e.message.headers,"x_frontier_ttl"))||0,u=ke(e.message.headers,"x_frontier_qos","2");if(!ke(e.message.headers,"x_frontier_qos_ack","1")||!u)if(u&&!this._qosDB&&(this._qosDB=it(),this._qosDB&&(yield this._qosDB.openDB())),u&&!this._qosDB.isReady&&(yield this._qosDB.openDB()),e.message.service>0&&s&&!t){if(a&&u)return void(!!(yield null===(n=this._qosDB)||void 0===n?void 0:n.get(a))||(this._dispatchMessageEvent(e),yield null===(r=this._qosDB)||void 0===r?void 0:r.set(a,Date.now()+c)));this._dispatchMessageEvent(e)}else if(e.message.service>0){if(a&&u)return void(!!(yield null===(i=this._qosDB)||void 0===i?void 0:i.get(a))||(this._dispatchMessageEvent(e),yield null===(o=this._qosDB)||void 0===o?void 0:o.set(a,Date.now()+c)));this._dispatchMessageEvent(e)}}))}function st(e){try{return"string"!=typeof e&&(e instanceof ArrayBuffer||e.buffer&&e.buffer instanceof ArrayBuffer)?"":"string"==typeof e?(JSON.parse(e),"application/json"):""}catch(t){return"string"==typeof e?"text/plain;charset=utf-8":""}}function at(e){return t(this,void 0,void 0,(function*(){this._uptimeTimeoutId=setTimeout((()=>ct.bind(this)(e)).bind(this),this._options.uptimeInterval)}))}function ct(e){var n,r;return t(this,void 0,void 0,(function*(){if(!this._ws||this._ws.readyState!==this.OPEN)return;const{pingInterval:t}=this._options;null===(n=this._endpointManager)||void 0===n||n.resetEndpointConfig();for(let e=0;e<this._messageQueue.length;e++){const t=this._messageQueue[e];if(this._ws.readyState!==this.OPEN||null===t)break;this._ws&&this._ws.send(t),this._messageQueue[e]=null}this._messageQueue=this._messageQueue.filter((e=>Boolean(e))),this._pingPongTimeoutId=setTimeout((()=>this._ping()),t),this._dispatchOpenEvent(e),this._isBrowser&&this._ws&&(this._ws.binaryType=this._binaryType);const i=null===(r=this._endpointManager)||void 0===r?void 0:r.getCurrentEndpoint();this._debug(`open ${i} success`)}))}function ut(){return t(this,void 0,void 0,(function*(){this._isInit=!1,clearTimeout(this._connectionTimeoutId)}))}function lt(e){var n,r;return t(this,void 0,void 0,(function*(){const t=ke(e.message.headers,"x_frontier_qos","2"),i=ke(e.message.headers,"x_frontier_is_ack","1"),o=null===(n=Ee(e.message.headers,"x_frontier_ack_msgid"))||void 0===n?void 0:n.split(",");if(t&&!this._qosDB&&(this._qosDB=it(),this._qosDB&&(yield this._qosDB.openDB())),t&&!this._qosDB.isReady&&(yield this._qosDB.openDB()),t&&i&&o&&o.length)for(const e of o)yield null===(r=this._qosDB)||void 0===r?void 0:r.del(e)}))}const dt=(e,t)=>{switch(e){case"boe":case"ppe":return{[`x-use-${e}`]:1,"x-tt-env":t};default:return{}}};class ft{constructor(e){this.maxLossCount=e,this.count=0}addCount(){this.count++}checkReachMaxCount(){return this.count>=this.maxLossCount}resetCounter(e=0){this.maxLossCount=e,this.count=0}}function pt(e){return"unknown reason"}class ht extends ve{constructor(n){super(),this._miniNavigatorOnline=!0,this._isBrowser=pe,this._isNode=ge,this._isMiniTT=he,this._isMiniWX=me,this._isWorker=_e,this._messageQueue=[],this._endpointManager=null,this._readyClosed=!1,this._binaryType="arraybuffer",this._connectLock=!1,this._connectionTimeoutId=null,this._uptimeTimeoutId=null,this._reconnectTimeoutId=null,this._pingPongTimeoutId=null,this._seqId=0,this._isInit=!1,this._url="",this._qosDB=null,this._pingLossCounter=null,this._protocols="pbbp2",this.CLOSED=3,this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this._onOpen=t=>{Ae(this,t,[ut,at]).then((()=>{var e;const t=null===(e=this._endpointManager)||void 0===e?void 0:e.getCurrentEndpoint();this._debug(`open ${t}`)})).catch((t=>{const n=ae("error",{message:t.message,code:e.ErrorCode.OPEN_ERROR});this._dispatchErrorEvent(n)}))},this._onMessage=n=>t(this,void 0,void 0,(function*(){const{pingInterval:t,pingFrequency:r}=this._options;("hi"===n.data&&"always"===r||"auto"===r)&&(this._clearPingTimer(),this.emit("ping_once_success","success"),this._pingPongTimeoutId=setTimeout((()=>this._ping()),t)),"hi"!==n.data&&Ae(this,n,[Ne,Se,lt,ot]).then((()=>{this._debug("received",n.message)})).catch((t=>{const n=ae("error",{message:t.message,code:e.ErrorCode.MESSAGE_ERROR});this._dispatchErrorEvent(n)}))})),this._onError=t=>{var n,r;const i=null===(n=this._endpointManager)||void 0===n?void 0:n.checkReachMaxTries(),o=null===(r=this._endpointManager)||void 0===r?void 0:r.getCurrentEndpoint();if(!i||t.message)this._ws&&this._ws.readyState===this.OPEN&&this._disconnect(),this._dispatchErrorEvent(ae("error",{message:t.message,code:e.ErrorCode.NATIVE_ERROR}));else{const t=`connect ${o} fail, max retries reached`;this._dispatchErrorEvent(ae("error",{message:t,code:e.ErrorCode.MAX_RETRIES_ERROR}))}},this._onClose=n=>t(this,void 0,void 0,(function*(){var t,r,i,o,s,a,c,u,l,d,f,p;this._clearTimer(),this._clearPingTimer(),this._removeWsListeners(),this._ws=null,this._connectLock=!1;const h=null===(t=this._endpointManager)||void 0===t?void 0:t.checkReachMaxTries();if(!h&&this._navigatorOnline()&&!this._readyClosed){const e=null===(r=this._endpointManager)||void 0===r?void 0:r.getCurrentEndpoint(),t=this._options.reconnectInterceptor(n.code,n.reason);return this._dispatchCloseEvent(ce("close",{code:1006,reason:n.reason||`connecting failed, unknown reason, hostname: ${e}`,willReconnect:t})),void(t&&this._connect())}if(1e3!==n.code&&this._readyClosed)return this._dispatchCloseEvent(ce("close",{code:1e3,reason:"bye"})),null===(i=this._endpointManager)||void 0===i||i.resetEndpointConfig(),void(null===(o=this._pingLossCounter)||void 0===o||o.resetCounter());if(1e3!==n.code&&h){const t=null===(s=this._endpointManager)||void 0===s?void 0:s.getCurrentEndpoint();let r=n.reason;r||(r=yield pt(this._url)),r=`connecting failed, ${r}, hostname: ${t}, max retries reached`,this._dispatchCloseEvent(ce("close",{code:n.code,reason:r}));const i=`connect ${t} fail, max retries reached`;return this._dispatchErrorEvent(ae("error",{message:i,code:e.ErrorCode.MAX_RETRIES_ERROR})),null===(a=this._endpointManager)||void 0===a||a.resetEndpointConfig(),void(null===(c=this._pingLossCounter)||void 0===c||c.resetCounter())}if(1e3!==n.code&&!n.reason){const e=null===(u=this._endpointManager)||void 0===u?void 0:u.getCurrentEndpoint();return this._dispatchCloseEvent(ce("close",{code:n.code,reason:`connecting failed, unknown reason, hostname: ${e}`})),null===(l=this._endpointManager)||void 0===l||l.resetEndpointConfig(),void(null===(d=this._pingLossCounter)||void 0===d||d.resetCounter())}this._dispatchCloseEvent(n),null===(f=this._endpointManager)||void 0===f||f.resetEndpointConfig(),null===(p=this._pingLossCounter)||void 0===p||p.resetCounter()})),this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this.onStartReconnect=null,this.onReceiveAck=null,this.onStopImmediatelyReconnect=null,this._options={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,uptimeInterval:1e3,maxRetries:5,debug:!1,maxMessageQueueLength:1/0,service:0,logIDGenerator:o,headers:void 0,payloadEncoding:"",payloadType:"",fpID:"",deviceID:"",accessKey:"",ttwID:"",bddID:"",aID:"",disableAutoReconnect:!1,customParams:{},pingInterval:15e3,pingTimeoutInterval:4e3,pingFrequency:"auto",pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};const{url:r,ws:i}=n,s=Array.isArray(r)?r:"string"==typeof r?[r]:[];if(!s||0===s.length)throw new Error("please provide valid url");if(!we(i))throw new Error("please provide ws params, WebSocket constructor is undefined");Object.assign(this._options,n),this._endpointManager=new fe(s,this._options.maxRetries),this._pingLossCounter=new ft(this._options.pingLossCount),this._options.automaticOpen&&(this._isInit=!0,this._connect()),this._options.listenNetworkChanged&&(this._isMiniTT||this._isMiniWX?this._onPageNetWorkChange():this._isBrowser&&this._initGlobalEventListener())}_handleOnLine(){this._options.disableAutoReconnect||this._readyClosed||this._handleReconnect()}_handleOffLine(){this._destroyWebSocket();const e=de("reconnect",{message:"stop immediately reconnect"});this.onStopImmediatelyReconnect&&this.onStopImmediatelyReconnect(e)}_initGlobalEventListener(){this._isBrowser&&window.addEventListener("online",this._handleOnLine.bind(this)),this._isBrowser&&window.addEventListener("offline",this._handleOffLine.bind(this)),this._isBrowser&&window.addEventListener("pagehide",this._handlePageHide.bind(this)),this._isBrowser&&window.addEventListener("pageshow",this._handlePageShow.bind(this))}_dropGlobalEventListener(){this._isBrowser&&window.removeEventListener("online",this._handleOnLine),this._isBrowser&&window.removeEventListener("offline",this._handleOffLine),this._isBrowser&&window.removeEventListener("pagehide",this._handlePageHide),this._isBrowser&&window.removeEventListener("pageshow",this._handlePageShow)}_handlePageHide(e){e.persisted||(this._isBrowser&&window.removeEventListener("pagehide",this._handlePageHide),this._isBrowser&&window.removeEventListener("pageshow",this._handlePageShow),this.close()),this._isBrowser&&window.removeEventListener("online",this._handleOnLine),this._isBrowser&&window.removeEventListener("offline",this._handleOffLine)}_handlePageShow(e){e.persisted&&(!this._navigatorOnline()||this._ws&&this._ws.readyState===this.OPEN&&this._ws.readyState===this.CONNECTING||this._handleOnLine(),this._isBrowser&&window.addEventListener("online",this._handleOnLine.bind(this)),this._isBrowser&&window.addEventListener("offline",this._handleOffLine.bind(this)))}_generateUrl(e){return t(this,void 0,void 0,(function*(){const{fpID:t,deviceID:n,bddID:r,ttwID:i,accessKey:o,aID:s,customParams:a={},enableAutoAck:c,enableQoS:u,env:l}=this._options;let d,f,p;this._isBrowser||this._isMiniWX||this._isMiniTT?(d=location&&"https:"==location.protocol?"wss://":"ws://",f=e.replace(/((^ws)|(^http))((?:[s]*:\/\/))/,""),p=/^wss(.*:\/\/)/.test(e)?e:`${d}${f}`):(d="wss://",f=e.replace(/(^http)((?:[s]*:\/\/))/,""),p=/(^ws)((?:[s]*:\/\/))/.test(f)?f:`${d}${f}`);const h=r?"bd_did":i?"ttwid":"device_id",m=r||i||n;if(!m||!h)throw new Error("please provide bddID, deviceID or ttwID");const _="function"==typeof a?yield a():a,g=l?dt(l.xUseEnv,l.xTTEnv):{},v=Object.assign(Object.assign({device_platform:"web",version_code:"fws_1.0.0",access_key:o,fpid:t,aid:s,[h]:m,xsack:c?1:0,xaack:c?1:0,xsqos:u?1:0},g),_);return`${p}/ws/v2${Object.keys(v).reduce(((e,t)=>`${e}${e?"&":"?"}${t}=${v[t]}`),"")}`}))}_connect(){var n,r,i,o,s,a,c;return t(this,void 0,void 0,(function*(){if(!this._connectLock&&!this._readyClosed){this._connectLock=!0;try{const t=null===(n=this._endpointManager)||void 0===n?void 0:n.checkCurrentEndpointReachedMaxRetries(),{timeoutInterval:u}=this._options;if(t){const t=null===(r=this._endpointManager)||void 0===r?void 0:r.getCurrentEndpoint(),n=null===(i=this._endpointManager)||void 0===i?void 0:i.replaceBackupEndpointAndUpdateCount(),s=null===(o=this._endpointManager)||void 0===o?void 0:o.getCurrentEndpointTriesCount();if(!n){const n=`connect ${t} timeout, max retries reached`;return this._debug(n),void this._dispatchErrorEvent(ae("error",{message:n,code:e.ErrorCode.MAX_RETRIES_ERROR}))}{const r=`connect ${t} timeout, max retries reached, will use backup endpoint ${n} to retry`,i=ae("error",{message:r,code:e.ErrorCode.MAX_RETRIES_ERROR});this._debug(r),this._dispatchErrorEvent(i),this._url=yield this._generateUrl(n),this._debug(`connect ${n} ${s} times`),this._removeWsListeners()}}else{const e=null===(s=this._endpointManager)||void 0===s?void 0:s.getCurrentEndpointAndUpdateCount(),t=null===(a=this._endpointManager)||void 0===a?void 0:a.getCurrentEndpointTriesCount();this._url=yield this._generateUrl(e||""),this._debug(`connect ${e} ${t} times`),this._removeWsListeners()}if(this._isInit)this._isInit=!1;else{const e=de("reconnect",{message:"start"});this.onStartReconnect&&this.onStartReconnect(e)}const l=(null===(c=this._endpointManager)||void 0===c?void 0:c.getCurrentEndpointTriesCount())||0;l>1&&(yield this._wait(l-1)),this._debug(`connecting url: ${this._url} protocols: ${this._protocols}`),this._ws=be({url:this._url,protocols:[this._protocols],headers:this._options.miniProgramParams.customHttpHeader},this._options.ws),(this._isBrowser||this._isWorker)&&this._ws&&(this._ws.binaryType=this._binaryType),this._addWsListeners(),this._connectionTimeoutId=setTimeout((()=>this._onTimeout()),u)}catch(t){throw this._connectLock=!1,t}}}))}_clearTimer(){clearTimeout(this._connectionTimeoutId),clearTimeout(this._uptimeTimeoutId),this._connectionTimeoutId=null,this._uptimeTimeoutId=null}_clearPingTimer(){clearTimeout(this._pingPongTimeoutId),clearTimeout(this._reconnectTimeoutId),this._pingPongTimeoutId=null,this._reconnectTimeoutId=null}_debug(...e){this._options.debug}_getIntervalValue(e){const{initReconnectInterval:t,maxReconnectInterval:n,reconnectIntervalGrowFactor:r}=this._options,i=t*Math.pow(r,e-1);return i>n?n:i}_ping(){this._ws&&this._ws.readyState===this.CONNECTING?this._pingPongTimeoutId=setTimeout((()=>this._ping()),this._options.pingInterval):this._ws&&this._ws.readyState===this.OPEN?(this._ws&&this._ws.send("hi"),this._reconnectTimeoutId=setTimeout((()=>{var e,t;null===(e=this._pingLossCounter)||void 0===e||e.addCount(),this.emit("ping_once_timeout","timeout"),(null===(t=this._pingLossCounter)||void 0===t?void 0:t.checkReachMaxCount())?this._handleReconnect():this._ping()}),this._options.pingTimeoutInterval)):this._handleReconnect()}_navigatorOnline(){return this._isMiniTT||this._isMiniWX?this._miniNavigatorOnline:!this._isBrowser&&!this._isWorker||!this._options.listenNetworkChanged||navigator.onLine}_handleReconnect(){var e,t;this._navigatorOnline()&&!this._readyClosed&&(null===(e=this._endpointManager)||void 0===e||e.resetEndpointConfig(),null===(t=this._pingLossCounter)||void 0===t||t.resetCounter(),this._ws?this._disconnect(1001,"going away, try reconnecting server",!0):this._connect())}_onPageNetWorkChange(){this._isMiniTT?tt.onNetworkStatusChange((({isConnected:e})=>{this._miniNavigatorOnline=e,e?this._handleOnLine():this._handleOffLine()})):this._isMiniWX&&wx.onNetworkStatusChange((({isConnected:e})=>{this._miniNavigatorOnline=e,e?this._handleOnLine():this._handleOffLine()}))}_wait(e){return new Promise((t=>{setTimeout(t,this._getIntervalValue(e))}))}_disconnect(e=1e3,t="",n=!1){this._ws&&this._destroyWebSocket(e,t,n)}_onTimeout(){var e;const t=null===(e=this._endpointManager)||void 0===e?void 0:e.getCurrentEndpoint();this._debug(`connect ${t} timeout`),this._disconnect(1001,"timeout, try reconnecting",!0)}_sendAck(e){const t=G(e);this._ws&&this._ws.readyState===this.OPEN&&(this._ws&&this._ws.send(t),this._debug("send_ack",e))}_removeWsListeners(){this._ws&&(this._ws.removeEventListener("open",this._onOpen),this._ws.removeEventListener("close",this._onClose),this._ws.removeEventListener("message",this._onMessage),this._ws.removeEventListener("error",this._onError))}_addWsListeners(){this._ws&&(this._ws.addEventListener("open",this._onOpen),this._ws.addEventListener("close",this._onClose),this._ws.addEventListener("message",this._onMessage),this._ws.addEventListener("error",this._onError))}_wsInstanceClose(e=1e3,t=""){try{this._ws&&this._ws.close(e,t)}catch(n){}}_destroyWebSocket(e=1e3,t="",n=!1){var r,i,o,s;if(this._clearPingTimer(),this._clearTimer(),this._removeWsListeners(),this._wsInstanceClose(1e3,t),this._connectLock=!1,n&&this._navigatorOnline()&&!this._readyClosed)if(null===(r=this._endpointManager)||void 0===r?void 0:r.checkReachMaxTries()){const e=null===(i=this._endpointManager)||void 0===i?void 0:i.getCurrentEndpoint();this._dispatchCloseEvent(ce("close",{code:1006,reason:`connect ${e} timeout, max retries reached`,wasClean:!0}))}else{const n=this._options.reconnectInterceptor(e,t);this._dispatchCloseEvent(ce("close",{code:e,reason:t,wasClean:!0,willReconnect:n})),n&&this._connect()}else this._navigatorOnline()||this._readyClosed?this._dispatchCloseEvent(ce("close",{code:e,reason:"bye"})):this._dispatchCloseEvent(ce("close",{code:1006,reason:"going away, network offline"})),this._ws=null,null===(o=this._endpointManager)||void 0===o||o.resetEndpointConfig(),null===(s=this._pingLossCounter)||void 0===s||s.resetCounter()}_dispatchOpenEvent(e){this.emit("open",e),this.onopen&&this.onopen(e)}_dispatchMessageEvent(e){this.emit("message",e),this.onmessage&&this.onmessage(e)}_dispatchAckMessageEvent(e){this.emit("ack",e),this.onReceiveAck&&this.onReceiveAck(e)}_dispatchErrorEvent(e){this.emit("error",e),this.onerror&&this.onerror(e)}_dispatchCloseEvent(e){this.emit("close",e),this.onclose&&this.onclose(e)}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)}get retryCount(){var e;return(null===(e=this._endpointManager)||void 0===e?void 0:e.getCurrentEndpointTriesCount())||0}get bufferedAmount(){return this._messageQueue.reduce(((e,t)=>e+=t&&t.byteLength||0),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.automaticOpen?this.CONNECTING:this.CLOSED}get url(){return this._ws?this._ws.url:this._url}close(e=1e3,t){var n;this._readyClosed=!0,this._clearTimer(),this._clearPingTimer(),null===(n=this._qosDB)||void 0===n||n.closeDB(),this._dropGlobalEventListener(),this._ws?this._ws.readyState!==this.CLOSED&&this._ws.readyState!==this.CLOSING?this._destroyWebSocket(e,t):this._debug("close, ws already closed"):this._debug("close, ws instance not initialized")}send(e,n){return t(this,void 0,void 0,(function*(){if(null==e)throw new Error("please provide a valid data, data must be a string or an arraybuffer");"number"==typeof e&&(e=JSON.stringify(e)),"string"==typeof e||e instanceof ArrayBuffer||e.buffer&&e.buffer instanceof ArrayBuffer||(e=JSON.stringify(e));const t=yield Oe(e),r=st(e),{method:o=0,service:s=this._options.service,logID:a=this._options.logIDGenerator(),headers:c=this._options.headers,payloadEncoding:u=this._options.payloadEncoding,payloadType:l=this._options.payloadType,logIDNew:d=(this._options.logIDNewConfig.enableAutoGenerateLogIDNew?i(this._options.logIDNewConfig.userIp):"")}=n||{};if(!s)throw new Error("please provide a valid service");const f={SeqID:K.fromNumber(this._seqId++),LogID:K.fromNumber(a),service:s,method:o,headers:c,payloadEncoding:u instanceof Object?u.encoding?u.encoding:"":u,payloadType:l instanceof Object?l.type?l.type:r:l||r,payload:t,LogIDNew:d},p=G(f);return this._ws&&this._ws.readyState===this.OPEN?(this._ws&&this._ws.send(p),this._debug("sent",f)):this._messageQueue.length<this._options.maxMessageQueueLength?(this._messageQueue.push(p),this._debug("enqueue",f)):(this._messageQueue.shift(),this._messageQueue.push(p)),this._seqId}))}reconnect(e){var n,r;return t(this,void 0,void 0,(function*(){const{url:t}=e||{},i=Array.isArray(t)?t:"string"==typeof t?[t]:[];e&&Object.assign(this._options,e),i&&i.length?this._endpointManager=new fe(i,this._options.maxRetries):null===(n=this._endpointManager)||void 0===n||n.resetEndpointConfig(),null===(r=this._pingLossCounter)||void 0===r||r.resetCounter(this._options.pingLossCount),this._readyClosed=!1,this._ws&&this._ws.readyState!==this.CLOSED?this._disconnect(1e3,"manual reconnecting",!0):(this._isInit=!0,this._connect())}))}connect(){var e,n;return t(this,void 0,void 0,(function*(){this._connectLock||(null===(e=this._endpointManager)||void 0===e||e.resetEndpointConfig(),null===(n=this._pingLossCounter)||void 0===n||n.resetCounter(),this._readyClosed=!1,this._isInit=!0,this._connect())}))}addEventListener(e,t){this.on(e,t)}dispatchEvent(e){const{type:t}=e;this.emit(t,e)}removeEventListener(e,t){this.off(e,t)}pingOnce(){return new Promise(((e,t)=>{this._clearPingTimer(),this._pingPongTimeoutId=setTimeout((()=>this._ping()),this._options.pingInterval);const n=()=>{e("success"),this.off("ping_once_success",n),this.off("ping_once_timeout",r)},r=()=>{t("timeout"),this.off("ping_once_success",n),this.off("ping_once_timeout",r)};this.on("ping_once_success",n),this.on("ping_once_timeout",r),this._ping()}))}}e.CustomCloseEvent=re,e.CustomErrorEvent=ne,e.Event=ee,e.FWS=ht,e.FrontierMessageEvent=oe,e.MessageEvent=ie,e.OpenEvent=se,e.ReconnectEvent=te,e.createCloseEvent=ce,e.createErrorEvent=ae,e.createMessageEvent=ue,e.createOpenEvent=le,e.createReconnectEvent=de,e.decodedFrame=U,e.encodeFrame=G,Object.defineProperty(e,"__esModule",{value:!0})}(t)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function i(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function a(e){i(s,r,o,a,c,"next",e)}function c(e){i(s,r,o,a,c,"throw",e)}a(void 0)}))}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}function c(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.r(r),n.d(r,{addFetchCrossHeaderHandler:()=>hy,callBackgroundMethodHandler:()=>jv,captureVisibleTabHandler:()=>fy,checkAndUpdateTtwidHandler:()=>Fv,closeSidePanelHandler:()=>Gv,csuiInitHandler:()=>zv,devtoolHandler:()=>Vv,fetchStreamHandler:()=>Jv,getConversationIdHandler:()=>Hv,getNewFeatureHandler:()=>Qg,getPageContentHandler:()=>Gy,getWindowInfoHandler:()=>Kv,httpRequestHandler:()=>$v,initShortcutHandler:()=>Yv,isONToolbarHandler:()=>Dv,isSidePanelEnabledHandler:()=>Xv,logoutHandler:()=>Qv,openDebugHandler:()=>Zv,openLoginHandler:()=>ry,openOptionsPageHandler:()=>iy,openSidePanelHandler:()=>oy,removeFetchCrossHeaderHandler:()=>py,requestFinishTTStream:()=>Ty,requestRegisterTTSAudio:()=>jy,requestStartTTSStream:()=>ky,requestStopAllAudios:()=>By,requestStopTTSStream:()=>Ey,requestTTSAudio:()=>yy,requestTTSStreamWithText:()=>Sy,screenCaptureHandler:()=>sy,startSummarizeHandler:()=>ay,startUsingHandler:()=>cy,tabInfoHandler:()=>Uv,toggleSidePanelHandler:()=>uy,tosGetFileUrl:()=>Fy,updateAuthInfoHandler:()=>ly,updateWebHitStatusHandler:()=>dy});var d=n(7685),f=n.n(d);let p;const h=()=>(void 0===p&&(p=f().getParser(navigator.userAgent).getPlatformType(!0).includes("mobile")),p);let m;const _=()=>{if("undefined"==typeof document)return!1;if(void 0===m){const{userAgent:e}=navigator,t=/iPad|iPhone|iPod/.test(e),n=e.includes("Macintosh")&&"ontouchstart"in document.documentElement;m=t||n}return m};const g=()=>/edge?\//.test(navigator.userAgent.toLowerCase()),v=()=>navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome");const y="object"==typeof global&&global&&global.Object===Object&&global;var b="object"==typeof self&&self&&self.Object===Object&&self;const w=y||b||Function("return this")();const k=w.Symbol;var E=Object.prototype,S=E.hasOwnProperty,T=E.toString,I=k?k.toStringTag:void 0;const x=function(e){var t=S.call(e,I),n=e[I];try{e[I]=void 0;var r=!0}catch(o){}var i=T.call(e);return r&&(t?e[I]=n:delete e[I]),i};var O=Object.prototype.toString;const N=function(e){return O.call(e)};var A=k?k.toStringTag:void 0;const R=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":A&&A in Object(e)?x(e):N(e)};const L=Array.isArray;const C=function(e){return null!=e&&"object"==typeof e};const P=function(e){return"string"==typeof e||!L(e)&&C(e)&&"[object String]"==R(e)};const M=function(e){return"number"==typeof e||C(e)&&"[object Number]"==R(e)},D=(e,t)=>{let n={};return Object.keys(e).forEach((r=>{const i=e[r],o=t?`${t}.${r}`:r;"object"==typeof i?n=l(l({},n),D(i,o)):n[o]=i})),n};function j(e){const t=D(e),n={},r={};for(const o in t){const e=t[o];if(M(e))n[o]=e;else try{r[o]=P(e)?e:JSON.stringify(e)}catch(i){}}return{metrics:n,categories:r}}function B(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const F=function(e){return null==e};var U=Object.prototype;const G=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||U)};const q=function(e,t){return function(n){return e(t(n))}};const W=q(Object.keys,Object);var z=Object.prototype.hasOwnProperty;const V=function(e){if(!G(e))return W(e);var t=[];for(var n in Object(e))z.call(e,n)&&"constructor"!=n&&t.push(n);return t};const J=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const H=function(e){if(!J(e))return!1;var t=R(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const K=w["__core-js_shared__"];var $,Y=($=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"";const X=function(e){return!!Y&&Y in e};var Q=Function.prototype.toString;const Z=function(e){if(null!=e){try{return Q.call(e)}catch(t){}try{return e+""}catch(t){}}return""};var ee=/^\[object .+?Constructor\]$/,te=Function.prototype,ne=Object.prototype,re=te.toString,ie=ne.hasOwnProperty,oe=RegExp("^"+re.call(ie).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const se=function(e){return!(!J(e)||X(e))&&(H(e)?oe:ee).test(Z(e))};const ae=function(e,t){return null==e?void 0:e[t]};const ce=function(e,t){var n=ae(e,t);return se(n)?n:void 0};const ue=ce(w,"DataView");const le=ce(w,"Map");const de=ce(w,"Promise");const fe=ce(w,"Set");const pe=ce(w,"WeakMap");var he="[object Map]",me="[object Promise]",_e="[object Set]",ge="[object WeakMap]",ve="[object DataView]",ye=Z(ue),be=Z(le),we=Z(de),ke=Z(fe),Ee=Z(pe),Se=R;(ue&&Se(new ue(new ArrayBuffer(1)))!=ve||le&&Se(new le)!=he||de&&Se(de.resolve())!=me||fe&&Se(new fe)!=_e||pe&&Se(new pe)!=ge)&&(Se=function(e){var t=R(e),n="[object Object]"==t?e.constructor:void 0,r=n?Z(n):"";if(r)switch(r){case ye:return ve;case be:return he;case we:return me;case ke:return _e;case Ee:return ge}return t});const Te=Se;const Ie=function(e){return C(e)&&"[object Arguments]"==R(e)};var xe=Object.prototype,Oe=xe.hasOwnProperty,Ne=xe.propertyIsEnumerable;const Ae=Ie(function(){return arguments}())?Ie:function(e){return C(e)&&Oe.call(e,"callee")&&!Ne.call(e,"callee")};const Re=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};const Le=function(e){return null!=e&&Re(e.length)&&!H(e)};const Ce=function(){return!1};var Pe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Me=Pe&&"object"==typeof module&&module&&!module.nodeType&&module,De=Me&&Me.exports===Pe?w.Buffer:void 0;const je=(De?De.isBuffer:void 0)||Ce;var Be={};Be["[object Float32Array]"]=Be["[object Float64Array]"]=Be["[object Int8Array]"]=Be["[object Int16Array]"]=Be["[object Int32Array]"]=Be["[object Uint8Array]"]=Be["[object Uint8ClampedArray]"]=Be["[object Uint16Array]"]=Be["[object Uint32Array]"]=!0,Be["[object Arguments]"]=Be["[object Array]"]=Be["[object ArrayBuffer]"]=Be["[object Boolean]"]=Be["[object DataView]"]=Be["[object Date]"]=Be["[object Error]"]=Be["[object Function]"]=Be["[object Map]"]=Be["[object Number]"]=Be["[object Object]"]=Be["[object RegExp]"]=Be["[object Set]"]=Be["[object String]"]=Be["[object WeakMap]"]=!1;const Fe=function(e){return C(e)&&Re(e.length)&&!!Be[R(e)]};const Ue=function(e){return function(t){return e(t)}};var Ge="object"==typeof exports&&exports&&!exports.nodeType&&exports,qe=Ge&&"object"==typeof module&&module&&!module.nodeType&&module,We=qe&&qe.exports===Ge&&y.process,ze=function(){try{var e=qe&&qe.require&&qe.require("util").types;return e||We&&We.binding&&We.binding("util")}catch(t){}}();const Ve=ze;var Je=Ve&&Ve.isTypedArray;const He=Je?Ue(Je):Fe;var Ke=Object.prototype.hasOwnProperty;const $e=function(e){if(null==e)return!0;if(Le(e)&&(L(e)||"string"==typeof e||"function"==typeof e.splice||je(e)||He(e)||Ae(e)))return!e.length;var t=Te(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(G(e))return!V(e).length;for(var n in e)if(Ke.call(e,n))return!1;return!0},Ye=["action","meta"],Xe=["action","meta"];class Qe{static merge(...e){return e.filter(Boolean).reduce(((e,t)=>function(e,t){const{action:n=[],meta:r}=e,i=B(e,Ye),{action:o=[],meta:s}=t,a=B(t,Xe),c=l(l({},r),s);return l(l(l({},i),a),{},{action:[...n,...o]},$e(c)?{}:{meta:c})}(e,t)),{})}constructor(e){c(this,"options",void 0),this.options=e}updateMeta(e){this.options.meta=e(this.options.meta)}get(){return this.options}}var Ze="info",et="success",nt="warning",rt="error",it="fatal",ot="console",st="persist";const at=["namespace","scope","level","message","eventName"],ct=["meta","message","eventName","action"];function ut(e,...t){let{namespace:n,scope:r,level:i,message:o,eventName:s}=e,a=B(e,at);const c=[`%c Logger %c ${n||i}${r?` %c ${r}`:""} %c`,"background:#444444 ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff",`background:${u=i,"success"===u?"#00CC00":"warning"===u?"#CC9900":"error"===u?"#CC3333":"fatal"===u?"#FF0000":"#0099CC"}; padding: 1px; border-radius: ${r?"0":"0 3px 3px 0"}; color: #fff`,r?"background:#777777; padding: 1px; border-radius: 0 3px 3px 0; color: #fff; margin-left: -1px;":"background:transparent"];var u;r&&c.push("background:transparent"),c.push(s||o);const l=a.error?a:a.meta;$e(l)||c.push(l),c.push(...t)}class lt{send(e){let{meta:t,message:n,eventName:r,action:i}=e,o=B(e,ct);const s=n||(r?`Event: ${r}`:void 0);if(null==i||!i.includes(ot)||!s)return;const a=l(l({},o),{},{message:s});t?ut(a,t):ut(a)}}const dt=new lt;function ft(e){return"string"==typeof e?{message:e}:e}const pt={level:Ze,action:[ot]};class ht{constructor({ctx:e={},clients:t=[],beforeSend:n=[],disableConsole:r}){c(this,"ctx",void 0),c(this,"logOptionsResolvers",[]),c(this,"disableConsole",void 0),c(this,"clients",void 0),this.ctx=new Qe(e),this.clients=t,this.logOptionsResolvers=n,this.disableConsole=r||!1}addClient(e){this.clients.push(e)}setClients(e){this.clients=e}resolveCloneParams({ctx:e,clients:t=[],beforeSend:n=[],disableConsole:r}){return{ctx:Qe.merge(this.ctx.get(),e),clients:[...this.clients,...t],beforeSend:[...this.logOptionsResolvers,...n],disableConsole:F(r)?this.disableConsole:r}}createLoggerWith(e){return new ht(this.resolveCloneParams(e))}log(e){const t=Qe.merge(pt,this.ctx.get(),e),n=this.logOptionsResolvers.length>0?this.logOptionsResolvers.reduce(((e,t)=>t?t(e):e),l({},t)):t;(this.disableConsole?this.clients.filter((e=>e!==dt)):this.clients).forEach((e=>{e.send(n)}))}fatal(e){this.log(l(l({},e),{},{level:it}))}error(e){this.log(l(l({},e),{},{level:rt}))}warning(e){this.log(l(l({},ft(e)),{},{level:nt}))}info(e){this.log(l(l({},ft(e)),{},{level:Ze}))}success(e){this.log(l(l({},ft(e)),{},{level:et}))}}const mt=["clients"];function _t({action:e=[],clients:t,disableConsole:n}){const r=t.includes(dt)||!e.includes(ot)?t:[dt,...t];return n?r.filter((e=>e!==dt)):r}class gt extends ht{constructor(e={}){var t;let{clients:n=[]}=e,r=B(e,mt);super(l({},r)),c(this,"persist",super.createLoggerWith({ctx:{action:[ot,st]}})),c(this,"console",super.createLoggerWith({ctx:{action:[ot]},clients:[dt]})),this.setClients(_t({action:null===(t=r.ctx)||void 0===t?void 0:t.action,clients:n,disableConsole:r.disableConsole}))}addClient(e){super.addClient(e),this.persist.addClient(e)}setClients(e){const t=_t({action:this.ctx.get().action,clients:e,disableConsole:this.disableConsole});super.setClients(t);const n=_t({action:this.persist.ctx.get().action,clients:e,disableConsole:this.disableConsole});this.persist.setClients(n)}createLoggerWith(e){return new gt(this.resolveCloneParams(e))}log(e){super.log(e)}fatal(e){super.fatal(e)}error(e){super.error(e)}warning(e){super.warning(e)}info(e){super.info(e)}success(e){super.success(e)}}const vt=function(){this.__data__=[],this.size=0};const yt=function(e,t){return e===t||e!=e&&t!=t};const bt=function(e,t){for(var n=e.length;n--;)if(yt(e[n][0],t))return n;return-1};var wt=Array.prototype.splice;const kt=function(e){var t=this.__data__,n=bt(t,e);return!(n<0)&&(n==t.length-1?t.pop():wt.call(t,n,1),--this.size,!0)};const Et=function(e){var t=this.__data__,n=bt(t,e);return n<0?void 0:t[n][1]};const St=function(e){return bt(this.__data__,e)>-1};const Tt=function(e,t){var n=this.__data__,r=bt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function It(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}It.prototype.clear=vt,It.prototype.delete=kt,It.prototype.get=Et,It.prototype.has=St,It.prototype.set=Tt;const xt=It;const Ot=function(){this.__data__=new xt,this.size=0};const Nt=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const At=function(e){return this.__data__.get(e)};const Rt=function(e){return this.__data__.has(e)};const Lt=ce(Object,"create");const Ct=function(){this.__data__=Lt?Lt(null):{},this.size=0};const Pt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var Mt=Object.prototype.hasOwnProperty;const Dt=function(e){var t=this.__data__;if(Lt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Mt.call(t,e)?t[e]:void 0};var jt=Object.prototype.hasOwnProperty;const Bt=function(e){var t=this.__data__;return Lt?void 0!==t[e]:jt.call(t,e)};const Ft=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Lt&&void 0===t?"__lodash_hash_undefined__":t,this};function Ut(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ut.prototype.clear=Ct,Ut.prototype.delete=Pt,Ut.prototype.get=Dt,Ut.prototype.has=Bt,Ut.prototype.set=Ft;const Gt=Ut;const qt=function(){this.size=0,this.__data__={hash:new Gt,map:new(le||xt),string:new Gt}};const Wt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const zt=function(e,t){var n=e.__data__;return Wt(t)?n["string"==typeof t?"string":"hash"]:n.map};const Vt=function(e){var t=zt(this,e).delete(e);return this.size-=t?1:0,t};const Jt=function(e){return zt(this,e).get(e)};const Ht=function(e){return zt(this,e).has(e)};const Kt=function(e,t){var n=zt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function $t(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}$t.prototype.clear=qt,$t.prototype.delete=Vt,$t.prototype.get=Jt,$t.prototype.has=Ht,$t.prototype.set=Kt;const Yt=$t;const Xt=function(e,t){var n=this.__data__;if(n instanceof xt){var r=n.__data__;if(!le||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yt(r)}return n.set(e,t),this.size=n.size,this};function Qt(e){var t=this.__data__=new xt(e);this.size=t.size}Qt.prototype.clear=Ot,Qt.prototype.delete=Nt,Qt.prototype.get=At,Qt.prototype.has=Rt,Qt.prototype.set=Xt;const Zt=Qt;const en=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const tn=function(e){return this.__data__.has(e)};function nn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Yt;++t<n;)this.add(e[t])}nn.prototype.add=nn.prototype.push=en,nn.prototype.has=tn;const rn=nn;const on=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const sn=function(e,t){return e.has(t)};const an=function(e,t,n,r,i,o){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(e),l=o.get(t);if(u&&l)return u==t&&l==e;var d=-1,f=!0,p=2&n?new rn:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var h=e[d],m=t[d];if(r)var _=s?r(m,h,d,t,e,o):r(h,m,d,e,t,o);if(void 0!==_){if(_)continue;f=!1;break}if(p){if(!on(t,(function(e,t){if(!sn(p,t)&&(h===e||i(h,e,n,r,o)))return p.push(t)}))){f=!1;break}}else if(h!==m&&!i(h,m,n,r,o)){f=!1;break}}return o.delete(e),o.delete(t),f};const cn=w.Uint8Array;const un=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const ln=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var dn=k?k.prototype:void 0,fn=dn?dn.valueOf:void 0;const pn=function(e,t,n,r,i,o,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new cn(e),new cn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return yt(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=un;case"[object Set]":var c=1&r;if(a||(a=ln),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var l=an(a(e),a(t),r,i,o,s);return s.delete(e),l;case"[object Symbol]":if(fn)return fn.call(e)==fn.call(t)}return!1};const hn=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e};const mn=function(e,t,n){var r=t(e);return L(e)?r:hn(r,n(e))};const _n=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o};const gn=function(){return[]};var vn=Object.prototype.propertyIsEnumerable,yn=Object.getOwnPropertySymbols;const bn=yn?function(e){return null==e?[]:(e=Object(e),_n(yn(e),(function(t){return vn.call(e,t)})))}:gn;const wn=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var kn=/^(?:0|[1-9]\d*)$/;const En=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&kn.test(e))&&e>-1&&e%1==0&&e<t};var Sn=Object.prototype.hasOwnProperty;const Tn=function(e,t){var n=L(e),r=!n&&Ae(e),i=!n&&!r&&je(e),o=!n&&!r&&!i&&He(e),s=n||r||i||o,a=s?wn(e.length,String):[],c=a.length;for(var u in e)!t&&!Sn.call(e,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||En(u,c))||a.push(u);return a};const In=function(e){return Le(e)?Tn(e):V(e)};const xn=function(e){return mn(e,In,bn)};var On=Object.prototype.hasOwnProperty;const Nn=function(e,t,n,r,i,o){var s=1&n,a=xn(e),c=a.length;if(c!=xn(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:On.call(t,l)))return!1}var d=o.get(e),f=o.get(t);if(d&&f)return d==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var h=s;++u<c;){var m=e[l=a[u]],_=t[l];if(r)var g=s?r(_,m,l,t,e,o):r(m,_,l,e,t,o);if(!(void 0===g?m===_||i(m,_,n,r,o):g)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var v=e.constructor,y=t.constructor;v==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof y&&y instanceof y||(p=!1)}return o.delete(e),o.delete(t),p};var An="[object Arguments]",Rn="[object Array]",Ln="[object Object]",Cn=Object.prototype.hasOwnProperty;const Pn=function(e,t,n,r,i,o){var s=L(e),a=L(t),c=s?Rn:Te(e),u=a?Rn:Te(t),l=(c=c==An?Ln:c)==Ln,d=(u=u==An?Ln:u)==Ln,f=c==u;if(f&&je(e)){if(!je(t))return!1;s=!0,l=!1}if(f&&!l)return o||(o=new Zt),s||He(e)?an(e,t,n,r,i,o):pn(e,t,c,n,r,i,o);if(!(1&n)){var p=l&&Cn.call(e,"__wrapped__"),h=d&&Cn.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,_=h?t.value():t;return o||(o=new Zt),i(m,_,n,r,o)}}return!!f&&(o||(o=new Zt),Nn(e,t,n,r,i,o))};const Mn=function e(t,n,r,i,o){return t===n||(null==t||null==n||!C(t)&&!C(n)?t!=t&&n!=n:Pn(t,n,r,i,e,o))};const Dn=function(e,t,n,r){var i=n.length,o=i,s=!r;if(null==e)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var c=(a=n[i])[0],u=e[c],l=a[1];if(s&&a[2]){if(void 0===u&&!(c in e))return!1}else{var d=new Zt;if(r)var f=r(u,l,c,e,t,d);if(!(void 0===f?Mn(l,u,3,r,d):f))return!1}}return!0};const jn=function(e){return e==e&&!J(e)};const Bn=function(e){for(var t=In(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,jn(i)]}return t};const Fn=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}};const Un=function(e){var t=Bn(e);return 1==t.length&&t[0][2]?Fn(t[0][0],t[0][1]):function(n){return n===e||Dn(n,e,t)}};const Gn=function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==R(e)};var qn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wn=/^\w*$/;const zn=function(e,t){if(L(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Gn(e))||(Wn.test(e)||!qn.test(e)||null!=t&&e in Object(t))};function Vn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Vn.Cache||Yt),n}Vn.Cache=Yt;const Jn=Vn;const Hn=function(e){var t=Jn(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t};var Kn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$n=/\\(\\)?/g;const Yn=Hn((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Kn,(function(e,n,r,i){t.push(r?i.replace($n,"$1"):n||e)})),t}));const Xn=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};var Qn=k?k.prototype:void 0,Zn=Qn?Qn.toString:void 0;const er=function e(t){if("string"==typeof t)return t;if(L(t))return Xn(t,e)+"";if(Gn(t))return Zn?Zn.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};const tr=function(e){return null==e?"":er(e)};const nr=function(e,t){return L(e)?e:zn(e,t)?[e]:Yn(tr(e))};const rr=function(e){if("string"==typeof e||Gn(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};const ir=function(e,t){for(var n=0,r=(t=nr(t,e)).length;null!=e&&n<r;)e=e[rr(t[n++])];return n&&n==r?e:void 0};const or=function(e,t,n){var r=null==e?void 0:ir(e,t);return void 0===r?n:r};const sr=function(e,t){return null!=e&&t in Object(e)};const ar=function(e,t,n){for(var r=-1,i=(t=nr(t,e)).length,o=!1;++r<i;){var s=rr(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Re(i)&&En(s,i)&&(L(e)||Ae(e))};const cr=function(e,t){return null!=e&&ar(e,t,sr)};const ur=function(e,t){return zn(e)&&jn(t)?Fn(rr(e),t):function(n){var r=or(n,e);return void 0===r&&r===t?cr(n,e):Mn(t,r,3)}};const lr=function(e){return e};const dr=function(e){return function(t){return null==t?void 0:t[e]}};const fr=function(e){return function(t){return ir(t,e)}};const pr=function(e){return zn(e)?dr(rr(e)):fr(e)};const hr=function(e){return"function"==typeof e?e:null==e?lr:"object"==typeof e?L(e)?ur(e[0],e[1]):Un(e):pr(e)};const mr=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}};const _r=function(){try{var e=ce(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();const gr=function(e,t,n){"__proto__"==t&&_r?_r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var vr=Object.prototype.hasOwnProperty;const yr=function(e,t,n){var r=e[t];vr.call(e,t)&&yt(r,n)&&(void 0!==n||t in e)||gr(e,t,n)};const br=function(e,t,n,r){if(!J(e))return e;for(var i=-1,o=(t=nr(t,e)).length,s=o-1,a=e;null!=a&&++i<o;){var c=rr(t[i]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=s){var l=a[c];void 0===(u=r?r(l,c,a):void 0)&&(u=J(l)?l:En(t[i+1])?[]:{})}yr(a,c,u),a=a[c]}return e};const wr=function(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=ir(e,s);n(a,s)&&br(o,nr(s,e),a)}return o};const kr=q(Object.getPrototypeOf,Object);const Er=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)hn(t,bn(e)),e=kr(e);return t}:gn;const Sr=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var Tr=Object.prototype.hasOwnProperty;const Ir=function(e){if(!J(e))return Sr(e);var t=G(e),n=[];for(var r in e)("constructor"!=r||!t&&Tr.call(e,r))&&n.push(r);return n};const xr=function(e){return Le(e)?Tn(e,!0):Ir(e)};const Or=function(e){return mn(e,xr,Er)};const Nr=function(e,t){if(null==e)return{};var n=Xn(Or(e),(function(e){return[e]}));return t=hr(t),wr(e,n,(function(e,n){return t(e,n[0])}))};const Ar=function(e,t){return Nr(e,mr(hr(t)))};const Rr=function(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===n(o[c],c,o))break}return t}};const Lr=Rr();const Cr=function(e,t){return e&&Lr(e,t,In)};const Pr=function(e,t){var n={};return t=hr(t,3),Cr(e,(function(e,r,i){gr(n,r,t(e,r,i))})),n},Mr={stringify:e=>{try{return JSON.stringify(e)}catch(t){return`JSON stringify Error: ${t.message}`}},parse:e=>{try{return JSON.parse(e||"")}catch(t){return null}}};class Dr extends Error{constructor(e){super(`httpStatus=${e.httpStatus}, code=${e.code}, message=${e.message}, logId=${e.logId}`),c(this,"errorOption",void 0),this.name="ApiError",this.errorOption=e}}var jr="ApiError",Br="Unknown";const Fr=e=>{return e&&e instanceof Dr?null!==(t=e.errorOption)&&void 0!==t&&t.errorType?e.errorOption.errorType:jr:Br;var t},Ur=e=>e?l(l({},(e=>{if(e instanceof Dr&&e.errorOption){const{errorOption:t}=e;return{httpStatus:t.httpStatus,code:t.code,logId:t.logId,response:Mr.stringify(t.response),requestConfig:Mr.stringify(t.requestConfig)}}return{}})(e)),{},{message:e.message,stack:e.stack,type:Fr(e)}):{},Gr=["level","message","eventName","meta","error"],qr=["reactInfo"],Wr={[Ze]:"info",[et]:"success",[nt]:"warn",[rt]:"error",[it]:"fatal"};function zr(e=Ze){return Wr[e]}const Vr={[Ze]:"info",[et]:"info",[nt]:"warn",[rt]:"error",[it]:"error"};function Jr(e=Ze){return Vr[e]}function Hr(e){const t={},n={};for(const r in e){const i=e[r];M(i)?t[r]=i:n[r]=P(i)?i:Mr.stringify(i)}return{metrics:t,categories:n}}function Kr(e){const t={};for(const n in e){const r=e[n];M(r)||P(r)?t[n]=r:t[n]=Mr.stringify(r)}return t}class $r{constructor(e){c(this,"loggerSlardarInstance",void 0),this.loggerSlardarInstance=e,this.loggerSlardarInstance}get slardarInstance(){const e=(t=this.loggerSlardarInstance,H(t)?t():t);var t;if(e)return e}send(e){var t;if(null===(t=e.action)||void 0===t||!t.includes(st))return;const{level:n,message:r,eventName:i,meta:o,error:s}=e,a=B(e,Gr),c=e=>function(e,t){const{keySeparator:n=".",maxDepth:r}=t||{},i=(e,t,o=1,s)=>{for(const[c,u]of Object.entries(e)){const e=s?`${s}${n}${c}`:c,l=o+1;u&&(a=u,"[object Object]"===Object.prototype.toString.call(a))&&(!r||l<=r)?i(u,t,l,e):t[e]=u}var a;return t};return i(e,{})}(l(l(l({},a),e),{},{error:Ur(s),level:zr(n)}),{maxDepth:4});if(n===rt&&!0===(null==o?void 0:o.reportJsError)){var u;const e=o||{},{reactInfo:t}=e,n=c(l(l({},B(e,qr)),{},{message:r,eventName:i}));null===(u=this.slardarInstance)||void 0===u||u.call(this,"captureException",s,Ar(Pr(n,(e=>P(e)?e:Mr.stringify(e))),F),t)}else if(i){var d;const e=c(l({},o)),{metrics:t,categories:n}=Hr(e);null===(d=this.slardarInstance)||void 0===d||d.call(this,"sendEvent",{name:i,metrics:t,categories:n})}else if(r){var f;const e=c(l({},o));null===(f=this.slardarInstance)||void 0===f||f.call(this,"sendLog",{level:Jr(n),content:r,extra:Kr(e)})}}}const Yr=new gt;const Xr=(0,n(4898).kT)(),Qr="undefined"!=typeof window?Xr:{};var Zr,ei;null===globalThis||void 0===globalThis||null===(Zr=globalThis.chrome)||void 0===Zr||null===(Zr=Zr.runtime)||void 0===Zr||null===(ei=Zr.getURL)||void 0===ei||ei.call(Zr,"side_panel.html");const ti={get JS_ERROR(){return"js_error"},get RESOURCE_ERROR(){return"resource_error"},get PROMISE_ERROR(){return"promise_error"},get FETCH_ERROR(){return"fetch_error"},get FETCH_REQUEST(){return"fetch_request"},get PAGE_CRASH(){return"page_crash"},get UNKNOW_ERROR(){return"unknow_error"}},ni=function(){let e={};return{getExtraInfo:()=>e,recordExtraInfo(t){e=l(l({},e),t)}}}();var ri=n(58311),ii=n(35625),oi=10,si=1e3,ai=function(e){return JSON.stringify({ev_type:"batch",list:e})};var ci=function(){return ci=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ci.apply(this,arguments)};function ui(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function li(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var di=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],fi=function(){return{}};function pi(e){return e}function hi(e){return"object"==typeof e&&null!==e}var mi=Object.prototype;function _i(e){return"[object Array]"===mi.toString.call(e)}function gi(e){return"number"==typeof e}function vi(e){return"string"==typeof e}function yi(e,t){if(!_i(e))return!1;if(0===e.length)return!1;for(var n=0;n<e.length;){if(e[n]===t)return!0;n++}return!1}var bi=function(e,t){if(!_i(e))return e;var n=e.indexOf(t);if(n>=0){var r=e.slice();return r.splice(n,1),r}return e};function wi(e){try{return vi(e)?e:JSON.stringify(e)}catch(t){return"[FAILED_TO_STRINGIFY]:"+String(t)}}var ki=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},Ei=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},Si=function(e){return Math.random()<Number(e)},Ti=function(e,t){return e<Number(t)},Ii=function(e){return function(t){for(var n=t,r=0;r<e.length&&n;r++)try{n=e[r](n)}catch(i){ki(i)}return n}};function xi(){var e=function(){for(var e=new Array(16),t=0,n=0;n<16;n++)3&n||(t=4294967296*Math.random()),e[n]=t>>>((3&n)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);var r=0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}(e)}function Oi(e){var t,n,r=e.builder,i=e.createSender,o=e.createDefaultConfig,s=e.createConfigManager,a=e.userConfigNormalizer,c=e.initConfigNormalizer,u=e.validateInitConfig,l={};di.forEach((function(e){return l[e]=[]}));var d=!1,f=!1,p=!1,h=[],m=[],_=function(){var e=!1,t={},n=function(e){e.length&&e.forEach((function(e){try{e()}catch(Mu){}})),e.length=0},r=function(e){t[e]&&t[e].forEach((function(e){n(e[1])})),t[e]=void 0};return{set:function(r,i,o){t[r]?t[r].push([i,o]):t[r]=[[i,o]],e&&n(o)},has:function(e){return!!t[e]},remove:r,removeByEvType:function(e){Object.keys(t).forEach((function(r){t[r]&&t[r].forEach((function(t){t[0]===e&&n(t[1])}))}))},clear:function(){e=!0,Object.keys(t).forEach((function(e){r(e)}))}}}(),g={getBuilder:function(){return r},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(e){if(d)Ei("already inited");else{if(!(e&&hi(e)&&u(e)))throw new Error("invalid InitConfig, init failed");var r=o(e);if(!r)throw new Error("defaultConfig missing");var a=c(e);if((n=s(r)).setConfig(a),n.onChange((function(){v("config")})),!(t=i(n.getConfig())))throw new Error("sender missing");d=!0,v("init",!0)}},set:function(e){d&&e&&hi(e)&&(v("beforeConfig",!1,e),null==n||n.setConfig(e))},config:function(e){if(d)return e&&hi(e)&&(v("beforeConfig",!1,e),null==n||n.setConfig(a(e))),null==n?void 0:n.getConfig()},provide:function(e,t){yi(m,e)?Ei("cannot provide "+e+", reserved"):(g[e]=t,v("provide",!1,e))},start:function(){var e=this;d&&(f||null==n||n.onReady((function(){f=!0,v("start",!0),h.forEach((function(t){return e.build(t)})),h.length=0})))},report:function(e){if(e){var t=Ii(l.beforeReport)(e);if(t){var n=Ii(l.report)(t);n&&(f?this.build(n):h.push(n))}}},build:function(e){if(f){var t=Ii(l.beforeBuild)(e);if(t){var n=r.build(t);if(n){var i=Ii(l.build)(n);i&&this.send(i)}}}},send:function(e){if(f){var n=Ii(l.beforeSend)(e);n&&(t.send(n),v("send",!1,n))}},destroy:function(){_.clear(),p=!0,h.length=0,v("beforeDestroy",!0)},on:function(e,t){if("init"===e&&d||"start"===e&&f||"beforeDestroy"===e&&p)try{t()}catch(n){}else l[e]&&l[e].push(t)},off:function(e,t){l[e]&&(l[e]=bi(l[e],t))},destroyAgent:_};return m=Object.keys(g),g;function v(e,t){void 0===t&&(t=!1);for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];l[e].forEach((function(e){try{e.apply(void 0,li([],ui(n),!1))}catch(t){}})),t&&(l[e].length=0)}}var Ni=function(e){var t=function(){var e={},t={},n={set:function(r,i){return e[r]=i,t[r]=wi(i),n},merge:function(r){return e=ci(ci({},e),r),Object.keys(r).forEach((function(e){t[e]=wi(r[e])})),n},delete:function(r){return delete e[r],delete t[r],n},clear:function(){return e={},t={},n},get:function(e){return t[e]},toString:function(){return ci({},t)}};return n}();e.provide("context",t),e.on("report",(function(e){return e.extra||(e.extra={}),e.extra.context=t.toString(),e}))};var Ai=function(){return Date.now()};var Ri=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar}(function(){if("object"==typeof window&&hi(window))return window}());n&&(n.errors||(n.errors=[]),n.errors.push(e))},Li="custom",Ci=function(e){e.provide("sendEvent",(function(t){var n=function(e){if(e&&hi(e)&&e.name&&vi(e.name)){var t={name:e.name,type:"event"};if("metrics"in e&&hi(e.metrics)){var n=e.metrics,r={};for(var i in n)gi(n[i])&&(r[i]=n[i]);t.metrics=r}if("categories"in e&&hi(e.categories)){var o=e.categories,s={};for(var i in o)s[i]=wi(o[i]);t.categories=s}return t}}(t);n&&e.report({ev_type:Li,payload:n,extra:{timestamp:Ai()}})})),e.provide("sendLog",(function(t){var n=function(e){if(e&&hi(e)&&e.content&&vi(e.content)){var t={content:wi(e.content),type:"log",level:"info"};if("level"in e&&(t.level=e.level),"extra"in e&&hi(e.extra)){var n=e.extra,r={},i={};for(var o in n)gi(n[o])?r[o]=n[o]:i[o]=wi(n[o]);t.metrics=r,t.categories=i}return t}}(t);n&&e.report({ev_type:Li,payload:n,extra:{timestamp:Ai()}})}))},Pi=function(e,t){var n=e.common||{};return n.sample_rate=t,e.common=n,e},Mi=function(e,t,n,r,i){return e?function(e){return function(){return e}}(i(r,t)):function(){return n(t)}},Di=function(e,t,n,r){var i=function(e,t,n){for(var r,i=ui(t.split(".")),o=i[0],s=i.slice(1);e&&s.length>0;)e=e[o],o=(r=ui(s))[0],s=r.slice(1);if(e)return n(e,o)}(e,t,(function(e,t){return e[t]}));if(void 0===i)return!1;var o=function(e){return"boolean"==typeof e}(i)?"bool":gi(i)?"number":"string";return function(e,t,n){switch(n){case"eq":return yi(t,e);case"neq":return!yi(t,e);case"gt":return e>t[0];case"gte":return e>=t[0];case"lt":return e<t[0];case"lte":return e<=t[0];case"regex":return Boolean(e.match(new RegExp(t.join("|"))));case"not_regex":return!e.match(new RegExp(t.join("|")));default:return!1}}(i,function(e,t){return e.map((function(e){switch(t){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}}))}(r,o),n)},ji=function(e,t){try{return"rule"===t.type?Di(e,t.field,t.op,t.values):"and"===t.type?t.children.every((function(t){return ji(e,t)})):t.children.some((function(t){return ji(e,t)}))}catch(n){return Ri(n),!1}},Bi=function(e,t,n,r,i){if(!t)return pi;var o=t.sample_rate,s=t.include_users,a=t.sample_granularity,c=t.rules,u=t.r,l=void 0===u?Math.random():u;if(yi(s,e))return function(e){return Pi(e,1)};var d="session"===a,f=Mi(d,o,n,l,r),p=function(e,t,n,r,i,o){var s={};return Object.keys(e).forEach((function(a){var c=e[a],u=c.enable,l=c.sample_rate,d=c.conditional_sample_rules;u?(s[a]={enable:u,sample_rate:l,effectiveSampleRate:l*n,hit:Mi(t,l,r,i,o)},d&&(s[a].conditional_hit_rules=d.map((function(e){var s=e.sample_rate,a=e.filter;return{sample_rate:s,hit:Mi(t,s,r,i,o),effectiveSampleRate:s*n,filter:a}})))):s[a]={enable:u,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}})),s}(c,d,o,n,l,r);return function(e){var t;if(!f())return d&&i[0](),!1;if(!(e.ev_type in p))return Pi(e,o);if(!p[e.ev_type].enable)return d&&i[1](e.ev_type),!1;if(null===(t=e.common)||void 0===t?void 0:t.sample_rate)return e;var n=p[e.ev_type],r=n.conditional_hit_rules;if(r)for(var s=0;s<r.length;s++)if(ji(e,r[s].filter))return!!r[s].hit()&&Pi(e,r[s].effectiveSampleRate);return n.hit()?Pi(e,n.effectiveSampleRate):((!r||!r.length)&&d&&i[1](e.ev_type),!1)}},Fi={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:ci(ci({},e.extra||{}),e.overrides||{})}}},Ui=function(e){var t,n=e,r={},i=fi,o=fi;return{getConfig:function(){return n},setConfig:function(s){var a;return r=ci(ci({},r),s||{}),(a=ci(ci({},e),r)).sample=function(e,t){if(!e||!t)return e||t;var n=ci(ci({},e),t);return n.include_users=li(li([],ui(e.include_users||[]),!1),ui(t.include_users||[]),!1),n.rules=li(li([],ui(Object.keys(e.rules||{})),!1),ui(Object.keys(t.rules||{})),!1).reduce((function(n,r){var i,o;return r in n||(r in(e.rules||{})&&r in(t.rules||{})?(n[r]=ci(ci({},e.rules[r]),t.rules[r]),n[r].conditional_sample_rules=li(li([],ui(e.rules[r].conditional_sample_rules||[]),!1),ui(t.rules[r].conditional_sample_rules||[]),!1)):n[r]=(null===(i=e.rules)||void 0===i?void 0:i[r])||(null===(o=t.rules)||void 0===o?void 0:o[r])),n}),{}),n}(e.sample,r.sample),n=a,o(),t||(t=s,i()),n},onChange:function(e){o=e},onReady:function(e){i=e,t&&i()}}};var Gi="mon.zijieapi.com",qi={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}};function Wi(e){return ci({},e)}function zi(e){return hi(e)&&"bid"in e&&"transport"in e}function Vi(e){return ci({},e)}var Ji=function(e){e.on("report",(function(t){return function(e,t){var n={url:"",protocol:"",domain:"",path:"",query:"",timestamp:Date.now(),sdk_version:t.version||"1.4.5",sdk_name:t.name||"SDK_BASE"};return ci(ci({},e),{extra:ci(ci({},n),e.extra||{})})}(t,e.config())}))},Hi=function(e){e.on("beforeBuild",(function(t){return function(e,t){var n={};return n.bid=t.bid,n.pid=t.pid,n.view_id=t.viewId,n.user_id=t.userId,n.device_id=t.deviceId,n.session_id=t.sessionId,n.release=t.release,n.env=t.env,ci(ci({},e),{extra:ci(ci({},n),e.extra||{})})}(t,e.config())}))};function Ki(e){return function(e){var t,n=e.transport,r=e.endpoint,i=e.size,o=void 0===i?oi:i,s=e.wait,a=void 0===s?si:s,c=[],u=0;function l(){if(c.length){var e=this.getBatchData();n.post({url:r,data:e,fail:function(n){t&&t(n,e)}}),c=[]}}return{getSize:function(){return o},getWait:function(){return a},setSize:function(e){o=e},setWait:function(e){a=e},getEndpoint:function(){return r},setEndpoint:function(e){r=e},send:function(e){c.push(e),c.length>=o&&l.call(this),clearTimeout(u),u=setTimeout(l.bind(this),a)},flush:function(){clearTimeout(u),l.call(this)},getBatchData:function(){return c.length?ai(c):""},clear:function(){clearTimeout(u),c=[]},fail:function(e){t=e}}}(e)}var $i=function(e,t){return void 0===t&&(t="/monitor_browser/collect/batch/"),(e&&e.indexOf("//")>=0?"":"https://")+e+t},Yi=function(e){return{bid:"",pid:"",viewId:(t="_",t+"_"+Date.now()),userId:xi(),deviceId:xi(),sessionId:xi(),domain:Gi,release:"",env:"production",sample:qi,plugins:{},transport:{get:fi,post:fi}};var t},Xi=function(e){var t=void 0===e?{}:e,n=t.createSender,r=void 0===n?function(e){return Ki({size:20,endpoint:$i(e.domain),transport:e.transport})}:n,i=t.builder,o=void 0===i?Fi:i,s=t.createDefaultConfig,a=Oi({validateInitConfig:zi,initConfigNormalizer:Wi,userConfigNormalizer:Vi,createSender:r,builder:o,createDefaultConfig:void 0===s?Yi:s,createConfigManager:Ui});return Ni(a),Hi(a),Ji(a),function(e,t){e.on("init",(function(){var n=[],r=function(r){r.forEach((function(r){var i=r.name;yi(n,i)||(n.push(i),r.setup(e),t&&t(i,r.setup),e.destroyAgent.set(i,i,[function(){n=bi(n,i),r.tearDown&&r.tearDown()}]))}))};e.provide("applyIntegrations",r);var i=e.config();i&&i.integrations&&r(i.integrations)}))}(a),a},Qi=function(e){void 0===e&&(e={});var t=Xi(e);return function(e){e.on("start",(function(){var t=e.config(),n=t.userId,r=t.sample,i=Bi(n,r,Si,Ti,[function(){e.destroy()},function(t){e.destroyAgent.removeByEvType(t)}]);e.on("build",i)}))}(t),Ci(t),t}(),Zi="heartbeat_response",eo="heartbeat",to="heartbeat_stop",no="pageVisibilityFalse",ro="pageVisibilityTrue",io="slardar_content_event",oo="slardar_content_log",so="slardar_content_perf_event";let ao=function(e){return e.CN="cn",e.MALIVA="maliva",e.SG="sg",e}({}),co=null;const uo=e=>(co||(e===ao.CN&&(co=Qi),e===ao.MALIVA&&(co=ii.Ay),e===ao.SG&&(co=ri.Ay)),co),lo=(...e)=>{},fo=(...e)=>{};let po=0;function ho(e,t=1e4){const n="string"==typeof e?{name:e}:e;return Promise.race([new Promise((e=>{try{chrome.runtime.sendMessage(n,(t=>{var r,i;chrome.runtime.lastError?(null!==(r=chrome.runtime.lastError.message)&&void 0!==r&&r.includes("message port closed")?(po++,po<10&&lo(`[runtime][lastError][\u65e0listener\u54cd\u5e94\u4e8b\u4ef6:->${n.name}]`,chrome.runtime.lastError)):fo(`[runtime][lastError]${n.name}`,chrome.runtime.lastError),e({success:!1,error:new Error(`[${n.name}]${null===(i=chrome.runtime.lastError)||void 0===i?void 0:i.message}`),data:t})):null!=t&&t.__hasError?e({success:!1,error:new Error(t.errorMessage)}):e({success:!0,data:t})}))}catch(t){e({success:!1,error:t})}})),new Promise((e=>{setTimeout((()=>e({success:!1,error:new Error("timeout")})),t)}))])}const mo=ho;var _o,go;const vo=null===(_o=globalThis.chrome)||void 0===_o?void 0:_o.runtime,yo=(null===(go=globalThis.chrome)||void 0===go||go.tabs,function(){var e=o((function*(){try{const e=yield chrome.tabs.query({active:!0,currentWindow:!0});return e.length?e[0]:null}catch(e){return null}}));return function(){return e.apply(this,arguments)}}());let bo="";const wo=()=>(bo||(bo=chrome.runtime.getManifest().version),bo);const ko=["tabId"];function Eo(e,t=1e4){const{tabId:n}=e,r=B(e,ko);return Promise.race([new Promise((e=>{try{chrome.tabs.sendMessage(n,r,(t=>{var n;chrome.runtime.lastError?("tab-activated"!==r.name&&fo(`[ms][bg][runtime.lastError]${r.name}`,chrome.runtime.lastError),e({success:!1,error:new Error(`[${r.name}]${null===(n=chrome.runtime.lastError)||void 0===n?void 0:n.message}`),data:t})):null!=t&&t.__hasError?e({success:!1,error:new Error(t.errorMessage)}):e({success:!0,data:t})}))}catch(t){e({success:!1,error:t})}})),new Promise((e=>{setTimeout((()=>e({success:!1,error:new Error("timeout")})),t)}))])}const So=function(){var e=o((function*(e){return To({status:"complete"},e.name,e.body)}));return function(t){return e.apply(this,arguments)}}(),To=function(){var e=o((function*(e,t,n){(yield chrome.tabs.query(e)).forEach((e=>{e.id&&Eo({tabId:e.id,name:t,body:n}).catch((()=>{}))}))}));return function(t,n,r){return e.apply(this,arguments)}}();function Io(e){return xo.apply(this,arguments)}function xo(){return(xo=o((function*(e,t=1e4){const n=yield yo();if(!n)return Promise.resolve({success:!1,data:{}});const r="string"==typeof e?{name:e}:e;return Eo(l({tabId:n.id},r),t)}))).apply(this,arguments)}class Oo{constructor(e,t){c(this,"category",ti.UNKNOW_ERROR),c(this,"msg",void 0),c(this,"url",void 0),c(this,"line",void 0),c(this,"col",void 0),c(this,"errorName",void 0),c(this,"statusCode",void 0),c(this,"stack",void 0),c(this,"logId",void 0),c(this,"pageUrl",void 0),c(this,"crashLog",void 0),c(this,"region",void 0),this.msg="",this.url="",this.line=0,this.col=0,this.errorName="",this.stack="",this.statusCode=0,this.logId="",this.pageUrl="",this.crashLog=null!=t&&t,this.region=null!=e?e:ao.SG}recordError(e){this.handleRecordError(e)}sendErrorToBg(e){if(!this.msg)return;const t=this.handleErrorInfo(e);ho({name:"slardar-message",body:{type:io,data:t}})}handleRecordError(e){try{var t,n;if(!this.msg)return;const r=this.handleErrorInfo(e);lo("[Daniel] slardar - error",this.region,r),null===(t=uo(this.region))||void 0===t||null===(n=t.sendEvent)||void 0===n||n.call(t,r)}catch(r){fo(r)}}handleErrorInfo(e){let t={name:(null==e?void 0:e.name)||"",metrics:{count:1},categories:{}};t.categories.currentTime=(new Date).toLocaleString(),t.categories.message=this.msg||"",encodeURIComponent(this.url)&&(t.categories.url=encodeURIComponent(this.url)||""),this.pageUrl&&(t.categories.pageUrl=this.pageUrl||""),this.line&&(t.categories.line=this.line||""),this.col&&(t.categories.column=this.col||""),this.stack&&(t.categories.stack=this.stack||""),this.errorName&&(t.categories.errorName=this.errorName||""),this.statusCode&&(t.categories.statusCode=this.statusCode),this.logId&&(t.categories.logId=this.logId);return Object.keys(ni.getExtraInfo()).forEach((e=>{t.categories[e]=ni.getExtraInfo()[e]})),t=l({},t),t}}const No=new class{constructor(){var e,t;c(this,"handlers",{}),c(this,"interceptors",[]),null===(e=chrome)||void 0===e||null===(e=e.runtime)||void 0===e||null===(e=e.onMessage)||void 0===e||null===(t=e.addListener)||void 0===t||t.call(e,this.onMessage.bind(this)),this.interceptors=[],this.handlers={}}onMessage(e,t,n){let r=!1;this.interceptors.forEach((i=>{r=r||Boolean(i.onMessage(e,t,n))}));const i=this.handlers[e.name];var s;return lo(`[runtime] onMessage -> [${e.name}][${i?"yes":"no"}] `,e.body||""),!!i&&(!i.preCheck||null!==(s=i.preCheck)&&void 0!==s&&s.call(i,t)?(o((function*(){try{const r=yield i.handle(e.body,t);n(r)}catch(r){n({__hasError:!0,errorMessage:`${r.message}[${e.name}]`})}}))(),!0):r)}supportExternal(){var e,t;null===(e=chrome)||void 0===e||null===(e=e.runtime)||void 0===e||null===(e=e.onMessageExternal)||void 0===e||null===(t=e.addListener)||void 0===t||t.call(e,this.onMessage.bind(this))}register(e){const{name:t}=e||{};t&&(this.handlers[t]&&fo(`[runtime] handler name[${t}] duplicated !`),lo(`[runtime] register handler for event: [${t}]`),this.handlers[t]=e)}unregister(e){delete this.handlers[e]}injectInterceptor(e){this.interceptors.push(e)}destroy(){this.handlers={},this.interceptors=[];try{chrome.runtime.onMessage.removeListener(this.onMessage)}catch(e){}}},Ao=e=>{const t=L(e)?e:[e];return t.forEach((e=>{No.register(e)})),()=>{t.forEach((e=>{No.unregister(e.name)}))}};const Ro=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var Lo=Math.max;const Co=function(e,t,n){return t=Lo(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Lo(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),Ro(e,this,a)}};const Po=function(e){return function(){return e}};const Mo=_r?function(e,t){return _r(e,"toString",{configurable:!0,enumerable:!1,value:Po(t),writable:!0})}:lr;var Do=Date.now;const jo=function(e){var t=0,n=0;return function(){var r=Do(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Mo);const Bo=function(e,t){return jo(Co(e,t,lr),e+"")};const Fo=function(e,t,n){(void 0!==n&&!yt(e[t],n)||void 0===n&&!(t in e))&&gr(e,t,n)};var Uo="object"==typeof exports&&exports&&!exports.nodeType&&exports,Go=Uo&&"object"==typeof module&&module&&!module.nodeType&&module,qo=Go&&Go.exports===Uo?w.Buffer:void 0,Wo=qo?qo.allocUnsafe:void 0;const zo=function(e,t){if(t)return e.slice();var n=e.length,r=Wo?Wo(n):new e.constructor(n);return e.copy(r),r};const Vo=function(e){var t=new e.constructor(e.byteLength);return new cn(t).set(new cn(e)),t};const Jo=function(e,t){var n=t?Vo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Ho=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Ko=Object.create;const $o=function(){function e(){}return function(t){if(!J(t))return{};if(Ko)return Ko(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const Yo=function(e){return"function"!=typeof e.constructor||G(e)?{}:$o(kr(e))};const Xo=function(e){return C(e)&&Le(e)};var Qo=Function.prototype,Zo=Object.prototype,es=Qo.toString,ts=Zo.hasOwnProperty,ns=es.call(Object);const rs=function(e){if(!C(e)||"[object Object]"!=R(e))return!1;var t=kr(e);if(null===t)return!0;var n=ts.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&es.call(n)==ns};const is=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};const os=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var a=t[o],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),i?gr(n,a,c):yr(n,a,c)}return n};const ss=function(e){return os(e,xr(e))};const as=function(e,t,n,r,i,o,s){var a=is(e,n),c=is(t,n),u=s.get(c);if(u)Fo(e,n,u);else{var l=o?o(a,c,n+"",e,t,s):void 0,d=void 0===l;if(d){var f=L(c),p=!f&&je(c),h=!f&&!p&&He(c);l=c,f||p||h?L(a)?l=a:Xo(a)?l=Ho(a):p?(d=!1,l=zo(c,!0)):h?(d=!1,l=Jo(c,!0)):l=[]:rs(c)||Ae(c)?(l=a,Ae(a)?l=ss(a):J(a)&&!H(a)||(l=Yo(c))):d=!1}d&&(s.set(c,l),i(l,c,r,o,s),s.delete(c)),Fo(e,n,l)}};const cs=function e(t,n,r,i,o){t!==n&&Lr(n,(function(s,a){if(o||(o=new Zt),J(s))as(t,n,a,r,e,i,o);else{var c=i?i(is(t,a),s,a+"",t,n,o):void 0;void 0===c&&(c=s),Fo(t,a,c)}}),xr)};const us=function e(t,n,r,i,o,s){return J(t)&&J(n)&&(s.set(n,t),cs(t,n,void 0,e,s),s.delete(n)),t};const ls=function(e,t,n){if(!J(n))return!1;var r=typeof t;return!!("number"==r?Le(n)&&En(t,n.length):"string"==r&&t in n)&&yt(n[t],e)};const ds=function(e){return Bo((function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,s&&ls(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var a=n[r];a&&e(t,a,r,o)}return t}))};const fs=ds((function(e,t,n,r){cs(e,t,n,r)}));const ps=Bo((function(e){return e.push(void 0,us),Ro(fs,void 0,e)}));const hs=ds((function(e,t,n){cs(e,t,n)})),ms="browser_language";function _s(e){e===ms&&"undefined"!=typeof window&&(e=navigator.language);const t=["zh","zh-cn","zh-sg","zh-hans","zh-hans-cn","zh-hans-sg"],n=e.toLowerCase();if(["en-gb"].includes(n))return e;const[r]=n.split(/-|_/);return"zh"===r?t.includes(n)?"zh":"zh-Hant":"ms"===r?"ms-MY":"th"===r?"th-TH":r}const gs=function(e,t,n){return null==e?e:br(e,t,n)},vs=(e,t,n,r)=>function(...i){return new(0,t.promiseModule)(((o,s)=>{t.multiArgs?i.push(((...e)=>{t.errorFirst?e[0]?s(e):(e.shift(),o(e)):o(e)})):t.errorFirst?i.push(((e,t)=>{e?s(e):o(t)})):i.push(o);const a=this===n?r:this;Reflect.apply(e,a,i)}))},ys=new WeakMap;function bs(e,t){t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const n=typeof e;if(null===e||"object"!==n&&"function"!==n)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===e?"null":n}\``);const r=new WeakMap,i=new Proxy(e,{apply(e,n,o){const s=r.get(e);if(s)return Reflect.apply(s,n,o);const a=t.excludeMain?e:vs(e,t,i,e);return r.set(e,a),Reflect.apply(a,n,o)},get(e,n){const o=e[n];if(!((e,n)=>{let r=ys.get(e);if(r||(r={},ys.set(e,r)),n in r)return r[n];const i=e=>"string"==typeof e||"symbol"==typeof n?n===e:e.test(n),o=Reflect.getOwnPropertyDescriptor(e,n),s=void 0===o||o.writable||o.configurable,a=(t.include?t.include.some((e=>i(e))):!t.exclude.some((e=>i(e))))&&s;return r[n]=a,a})(e,n)||o===Function.prototype[n])return o;const s=r.get(o);if(s)return s;if("function"==typeof o){const n=vs(o,t,i,e);return r.set(o,n),n}return o}});return i}var ws=class{#e;#t;get primaryClient(){return this.#t}#n;get secondaryClient(){return this.#n}#r;get area(){return this.#r}get hasWebApi(){try{return typeof window<"u"&&!!window.localStorage}catch(e){return!1}}#i=new Map;#o;get copiedKeySet(){return this.#o}isCopied=e=>this.hasWebApi&&(this.allCopied||this.copiedKeySet.has(e));#s=!1;get allCopied(){return this.#s}getExtStorageApi=()=>globalThis.browser?.storage||globalThis.chrome?.storage;get hasExtensionApi(){try{return!!this.getExtStorageApi()}catch(e){return!1}}isWatchSupported=()=>this.hasExtensionApi;keyNamespace="";isValidKey=e=>e.startsWith(this.keyNamespace);getNamespacedKey=e=>`${this.keyNamespace}${e}`;getUnnamespacedKey=e=>e.slice(this.keyNamespace.length);constructor({area:e="sync",allCopied:t=!1,copiedKeyList:n=[]}={}){this.setCopiedKeySet(n),this.#r=e,this.#s=t;try{this.hasWebApi&&(t||n.length>0)&&(this.#n=window.localStorage)}catch{}try{this.hasExtensionApi&&(this.#e=this.getExtStorageApi(),(()=>{try{let e=(globalThis.navigator?.userAgent).match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if("Chrome"===e[1])return parseInt(e[2])<100||2===globalThis.chrome.runtime?.getManifest()?.manifest_version}catch{return!1}return!1})()?this.#t=bs(this.#e[this.area],{exclude:["getBytesInUse"],errorFirst:!1}):this.#t=this.#e[this.area])}catch{}}setCopiedKeySet(e){this.#o=new Set(e)}rawGetAll=()=>this.#t?.get();getAll=async()=>{let e=await this.rawGetAll();return Object.entries(e).filter((([e])=>this.isValidKey(e))).reduce(((e,[t,n])=>(e[this.getUnnamespacedKey(t)]=n,e)),{})};copy=async e=>{let t=void 0===e;if(!t&&!this.copiedKeySet.has(e)||!this.allCopied||!this.hasExtensionApi)return!1;let n=this.allCopied?await this.rawGetAll():await this.#t.get((t?[...this.copiedKeySet]:[e]).map(this.getNamespacedKey));if(!n)return!1;let r=!1;for(let i in n){let e=n[i],t=this.#n?.getItem(i);this.#n?.setItem(i,e),r||=e!==t}return r};rawGet=async e=>this.hasExtensionApi?(await this.#t.get(e))[e]:this.isCopied(e)?this.#n?.getItem(e):null;rawSet=async(e,t)=>(this.isCopied(e)&&this.#n?.setItem(e,t),this.hasExtensionApi&&await this.#t.set({[e]:t}),null);clear=async(e=!1)=>{e&&this.#n?.clear(),await this.#t.clear()};rawRemove=async e=>{this.isCopied(e)&&this.#n?.removeItem(e),this.hasExtensionApi&&await this.#t.remove(e)};removeAll=async()=>{let e=await this.rawGetAll(),t=Object.keys(e);await Promise.all(t.map(this.rawRemove))};watch=e=>{let t=this.isWatchSupported();return t&&this.#a(e),t};#a=e=>{for(let t in e){let n=this.getNamespacedKey(t),r=this.#i.get(n)?.callbackSet||new Set;if(r.add(e[t]),r.size>1)continue;let i=(e,t)=>{if(t!==this.area||!e[n])return;let r=this.#i.get(n);Promise.all([this.parseValue(e[n].newValue),this.parseValue(e[n].oldValue)]).then((([e,n])=>{for(let i of r.callbackSet)i({newValue:e,oldValue:n},t)}))};this.#e.onChanged.addListener(i),this.#i.set(n,{callbackSet:r,listener:i})}};unwatch=e=>{let t=this.isWatchSupported();return t&&this.#c(e),t};#c(e){for(let t in e){let n=this.getNamespacedKey(t),r=e[t];if(this.#i.has(n)){let e=this.#i.get(n);e.callbackSet.delete(r),0===e.callbackSet.size&&(this.#i.delete(n),this.#e.onChanged.removeListener(e.listener))}}}unwatchAll=()=>this.#u();#u(){this.#i.forEach((({listener:e})=>this.#e.onChanged.removeListener(e))),this.#i.clear()}async getItem(e){return this.get(e)}async setItem(e,t){await this.set(e,t)}async removeItem(e){return this.remove(e)}};const ks=new class extends ws{get=async e=>{let t=this.getNamespacedKey(e),n=await this.rawGet(t);return this.parseValue(n)};set=async(e,t)=>{let n=this.getNamespacedKey(e),r=JSON.stringify(t);return this.rawSet(n,r)};remove=async e=>{let t=this.getNamespacedKey(e);return this.rawRemove(t)};setNamespace=e=>{this.keyNamespace=e};parseValue=async e=>{try{if(void 0!==e)return JSON.parse(e)}catch(t){}}}({area:"local"});const Es=function(){var e=o((function*(e){const t=Object.keys(e),n=Object.values(e),r=yield Promise.all(t.map((e=>ks.get(e))));for(let s=0;s<t.length;s++)if(void 0!==r[s]){const o=r[s];let a=o;if(null!==(i=o)&&"object"==typeof i&&!Array.isArray(i)){const e=Object.assign({},o);a=ps(e,n[s])}gs(e,t[s],a)}var i;const o=t.reduce(((t,n)=>l(l({},t),{},{[n]:t=>{gs(e,n,t.newValue)}})),{});return ks.watch(o),()=>{ks.unwatch(o)}}));return function(t){return e.apply(this,arguments)}}(),Ss={web_search:{count:0},web_ask:{count:0},web_translate:{count:0},web_explain:{count:0},web_grammar:{count:0},web_rewrite:{count:0},web_video_summary:{count:0},web_summary:{count:0},web_translatePage:{count:0},web_gmail:{count:0},web_podcast_summary:{count:0},sidebar_pdf_summary:{count:0},sidebar_pdf_highlight:{count:0}},Ts=(Object.keys(Ss),["web_ask","web_translate","web_translatePage"]);Object.keys(Ss).reduce(((e,t)=>l(l({},e),{},{[t]:Ts.includes(t)?10:Number.MAX_SAFE_INTEGER})),{});let Is=function(e){return e.chatAssistant="sidebarButton",e.searchAssistant="search",e.selectAssistant="quick",e.grammar="grammar",e.inputAssistant="input",e.replyAssistant="reply",e.searchAddons="search-addons",e.videoSummary="videoSummary",e.videoSubtitle="videoSubtitle",e.videoImmersion="videoImmersion",e.videoMemo="videoMemo",e.podcastSummary="podcastSummary",e.linkPreview="linkPreview",e.sidebarFloatCard="sidebarFloatCard",e.vocabruary="vocabruary",e.collectionImage="collectionImage",e.collectionPage="collectionPage",e}({}),xs=function(e){return e.temp="temp",e.page="page",e.global="global",e}({}),Os=function(e){return e.HUOSHAN="huoshan",e.DOUBAO="doubao",e.GPT="gpt",e.GOOGLE="google",e.MICROSOFT="microsoft",e.DEEPL="deepl",e}({}),Ns=function(e){return e.NO_TRANSLATE="no_translate",e.TRANSLATE_DIRECTLY="translate_directly",e.TRANSLATE_BY_COMMAND="translate_by_command",e.TRANSLATE_BY_OPTION="translate_by_option",e.TRANSLATE_BY_CUSTOM_SHORTCUT="translate_by_custom_shortcut",e}({}),As=function(e){return e.Space="Space",e.Comma="Comma",e.Slash="Slash",e.Equal="Equal",e}({});const Rs="www.doubao.com",Ls="586864",Cs="tab-id-need-open-sidebar",Ps=`https://${Rs}/samantha`,Ms=`https://${Rs}/alice`,Ds="ciciai.com",js="doubao.com",Bs="release_version";xs.temp,xs.page,xs.global,Is.sidebarFloatCard,Is.videoSubtitle,Is.videoSummary,Is.videoMemo,Is.podcastSummary,Is.chatAssistant,Is.searchAssistant,Is.selectAssistant,Is.grammar,Is.inputAssistant,Is.searchAddons,Is.linkPreview,Is.videoImmersion,Is.replyAssistant,Is.vocabruary,Is.collectionImage;let Fs=function(e){return e[e.Youtube=1]="Youtube",e[e.Podcast=2]="Podcast",e[e.Bilibili=3]="Bilibili",e}({});const Us="https://www.doubao.com/service/settings/v3/",Gs={vocabruary:{disable_hosts:[]},spotlight:{enable:!0,disable_hosts:[]},writing_assistant:{enabled:!0,input_tag_disabled:!1,input_enabled_urls:[],input_disabled_urls:[],input_enabled_size:{width:300,height:64},rich_enabled_urls:[],rich_disabled_urls:[]},search_assistant:{mindmap_show:!0,max_half_content_show_count:3,max_search_auto_summary_count:30,max_search_auto_summary_time:2592e5},search_addons:{search_button_show:!0,feed_card_show:!0,feed_card_config:[[function(e){return e[e.WebCard=1]="WebCard",e}({}).WebCard,Fs.Podcast,3]]},goto_doubao:{enabled:!0,notice_key:"1"},link_preview:{search_engine_enabled:!0,page_enabled:!0,disable_hosts:["www.youtube.com","*.bilibili.com","www.douyin.com","www.ixigua.com","www.youku.com","v.qq.com","tv.sohu.com","www.iqiyi.com","www.yangshipin.cn","www.miguvideo.com","meego.larkoffice.com","code.byted.org","data.bytedance.net","*.wikipedia.org","*.zhihu.com"]},video_assistant:{youtube_assistant_show:!0,bilibili_assistant_show:!0,mindmap_show:!0,video_sharing_enabled:!1,video_list:!0,subtitle_search_enabled:!0,bilibili_mount_config:[{container_selector:"#reco_list",is_child:!1,mount_position:"before"},{container_selector:"#danmukuBox",is_child:!0,mount_position:"before"}]},assistant_mount_config:{custom_attr:[],b_feature_dom_disabled:!1},podcast_assistant:{enable:!0,mindmap_show:!0,subtitle_search_enabled:!0},latest_version:{store_version:""},input_translate_assistant:{enable:!0},hover_translate_assistant:{enable:!0},lark_urls:{url_list:["larkoffice.com","feishu.cn"]},feishu_select_toolbar:{enable:!0},capture_assistant:{enable:!0,enable_exercise:!0,enable_pic_qa:!1,enable_collect:!0},reply_assistant:{enabled:!0},mindmap_options:{spacingHorizontal:50,spacingVertical:14,maxWidth:300},update_notice:{enabled:!0},collection_assistant:{podcast_enabled:!0,image_enabled:!0,image_collection_disable_hosts:[],image_enabled_size:{width:120,height:120}},voice_input:{enabled:!0},sidebar_translate:{enabled:!0},read_webpage_context:{default_enable_context:!0},tts:{ttsReadPageEnabled:!1,selectBarPronounceEnabled:!0},mail:{enabled:!0},selection_bar:{diagram_enabled:!0,disabled_urls:["*.kdocs.cn/**"]}};let qs=function(e){return e.OpenSide="OpenSide",e.OpenSpotlight="OpenSpotlight",e.TranslatePage="TranslatePage",e.ReadPage="ReadPage",e.HoverTextTranslate="HoverTextTranslate",e.ScreenCapture="ScreenCapture",e.VoiceInput="VoiceInput",e.CollectPage="CollectPage",e.BilingualSubtitles="BilingualSubtitles",e.TTSReadPage="TTSReadPage",e}({});const Ws=(()=>{let e=null;return()=>(null===e&&(e="macos"===f().getParser(navigator.userAgent).getOSName(!0)),e)})();function zs(e){const t=Ws();switch(e){case qs.OpenSide:return t?`${Vs.Command}+K`:`${Vs.Ctrl}+K`;case qs.OpenSpotlight:return t?`${Vs.Command}+J`:`${Vs.Ctrl}+J`;case qs.TranslatePage:return t?`${Vs.Option}+1`:`${Vs.Alt}+1`;case qs.ReadPage:return t?`${Vs.Option}+2`:`${Vs.Alt}+2`;case qs.HoverTextTranslate:return t?`${Vs.Command}`:`${Vs.Ctrl}`;case qs.ScreenCapture:return t?`${Vs.Option}+3`:`${Vs.Alt}+3`;case qs.CollectPage:return t?`${Vs.Option}+4`:`${Vs.Alt}+4`;case qs.TTSReadPage:return t?`${Vs.Option}+5`:`${Vs.Alt}+5`;case qs.VoiceInput:return"B";case qs.BilingualSubtitles:return"H";default:return""}}let Vs=function(e){return e.Command="Command",e.Windows="Windows",e.Ctrl="Ctrl",e.Alt="Alt",e.Option="Option",e.Shift="Shift",e}({});let Js=function(e){return e.Command="Command",e.Option="Option",e}({});Js.Command,Vs.Command,Vs.Ctrl,Js.Option,Vs.Option,Vs.Alt;const Hs={[qs.OpenSide]:{key:zs(qs.OpenSide),desc:"open sidebar/sidepanel or ai search"},[qs.OpenSpotlight]:{key:zs(qs.OpenSpotlight),desc:"open Spotlight"},[qs.TranslatePage]:{key:zs(qs.TranslatePage),desc:"translate page"},[qs.ReadPage]:{key:zs(qs.ReadPage),desc:"read page"},[qs.HoverTextTranslate]:{key:zs(qs.HoverTextTranslate),desc:"hover text translate"},[qs.ScreenCapture]:{key:zs(qs.ScreenCapture),desc:"screen capture"},[qs.VoiceInput]:{key:zs(qs.VoiceInput),desc:"voice input"},[qs.CollectPage]:{key:zs(qs.CollectPage),desc:"collect page"},[qs.BilingualSubtitles]:{key:zs(qs.BilingualSubtitles),desc:"bilingual subtitles"},[qs.TTSReadPage]:{key:zs(qs.TTSReadPage),desc:"tts read page"}};var Ks="pronounce",$s="explain",Ys="translate",Xs="summarize",Qs="grammar",Zs="rewrite",ea="browser_ask",ta="copy",na="collect",ra="adjust_skill",ia="diagram";[{cnName:"\u200b\u4e2d\u6587\u200b",enName:"Chinese\u200b",name:"\u4e2d\u6587",lang:"zh"},{cnName:"\u82f1\u6587\u200b",enName:"English\u200b",name:"English",lang:"en"},{cnName:"\u65e5\u8bed\u200b",enName:"Japanese\u200b",name:"\u65e5\u672c\u8a9e",lang:"ja"},{cnName:"\u97e9\u8bed\u200b",enName:"Korean\u200b",name:"\ud55c\uad6d\uc5b4",lang:"ko"},{cnName:"\u6cd5\u8bed\u200b",enName:"French\u200b",name:"Fran\xe7ais",lang:"fr"},{cnName:"\u5fb7\u8bed\u200b",enName:"German\u200b",name:"Deutsch",lang:"de"},{cnName:"\u897f\u73ed\u7259\u8bed\u200b",enName:"Spanish\u200b",name:"Espa\xf1ol",lang:"es"},{cnName:"\u4fc4\u8bed\u200b",enName:"Russian\u200b",name:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",lang:"ru"},{cnName:"\u610f\u5927\u5229\u8bed\u200b",enName:"Italian\u200b",name:"Italiano",lang:"it"},{cnName:"\u8461\u8404\u7259\u8bed\u200b",enName:"Portuguese\u200b",name:"Portugu\xeas",lang:"pt"},{cnName:"\u8377\u5170\u8bed\u200b",enName:"Dutch\u200b",name:"Nederlands",lang:"nl"},{cnName:"\u745e\u5178\u8bed\u200b",enName:"Swedish\u200b",name:"Svenska",lang:"sv"},{cnName:"\u4e39\u9ea6\u8bed\u200b",enName:"Danish\u200b",name:"Dansk",lang:"da"},{cnName:"\u632a\u5a01\u8bed\u200b",enName:"Norwegian\u200b",name:"Norsk",lang:"no"},{cnName:"\u6ce2\u5170\u8bed\u200b",enName:"Polish\u200b",name:"Polski",lang:"pl"},{cnName:"\u5e0c\u814a\u8bed\u200b",enName:"Greek\u200b",name:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",lang:"el"},{cnName:"\u571f\u8033\u5176\u8bed\u200b",enName:"Turkish\u200b",name:"T\xfcrk\xe7e",lang:"tr"},{cnName:"\u8d8a\u5357\u8bed\u200b",enName:"Vietlangse\u200b",name:"Ti\u1ebfng Vi\u1ec7t",lang:"vi"},{cnName:"\u6cf0\u8bed\u200b",enName:"Thai\u200b",name:"\u0e44\u0e17\u0e22",lang:"th"},{cnName:"\u5370\u5730\u8bed\u200b",enName:"Hindi\u200b",name:"\u0939\u093f\u0928\u094d\u0926\u0940\u200b",lang:"hi"}].reduce(((e,t)=>(e[t.lang]=t.name,e)),{});const oa=[{id:ea,prompt:"",name:"flow_web_ext_action_ask",icon:"searchAI"},{id:$s,prompt:"\u89e3\u91ca\u8fd9\u6bb5\u6587\u672c: \n\u201d\u201d\u201d\n$[text]\n\u201d\u201d\u201d",name:"flow_web_ext_action_explain",icon:"explain"},{id:Ys,prompt:"\u628a\u4e0b\u9762\u8fd9\u6bb5\u6587\u672c\u7ffb\u8bd1\u6210\u76ee\u6807\u8bed\u8a00: $[lang]\u3002\u9700\u8981\u7ffb\u8bd1\u7684\u5185\u5bb9\u662f: \n\u201d\u201d\u201d\n$[text]\n\u201d\u201d\u201d",name:"flow_web_ext_action_translate",icon:"IconTranslateOutline"},{id:Ks,prompt:"",name:"\u6717\u8bfb",icon:"IconPlayAudio"},{id:Xs,prompt:"\u603b\u7ed3\u4ee5\u4e0b\u5185\u5bb9: \n\u201d\u201d\u201d\n$[text]\n\u201d\u201d\u201d",name:"flow_web_ext_action_summarize",icon:"summarize"},{id:Qs,prompt:"\u6821\u5bf9\u5e76\u7ea0\u6b63\u8fd9\u6bb5\u6587\u5b57: \n\u201d\u201d\u201d\n$[text]\n\u201d\u201d\u201d",name:"flow_web_ext_action_grammar",icon:"check"},{id:ra,prompt:"\u91cd\u65b0\u8868\u8ff0\u8fd9\u6bb5\u6587\u5b57, \u4f7f\u8fd9\u6bb5\u6587\u5b57\u8868\u8ff0\u7684\u66f4\u52a0\u5408\u7406: \n\u201d\u201d\u201d\n$[text]\n\u201d\u201d\u201d",name:"modify_change_tone",icon:"adjust_skill"},{id:ta,prompt:"",name:"message_long_press_copy",icon:"copy"},{id:na,prompt:"",name:"flow_web_ext_action_bookmarks",icon:"collect",options:{brand:"\u8c46\u5305"}},{id:ia,prompt:"",name:"flow_web_ext_diagram",icon:"diagram"}],sa=new Set([ea]),aa=[$s,Ys,Ks,na],ca=[ta],ua=new Set([Xs]),la=(e=[])=>oa.filter((t=>aa.includes(t.id)&&!ua.has(t.id)&&!e.includes(t.id))),da=(e=[])=>oa.filter((t=>ca.includes(t.id)&&!ua.has(t.id)&&!e.includes(t.id))),fa=[Qs,Zs,na,Ks,ra],pa=[$s,Ys,ta],ha=(e=[])=>oa.filter((t=>fa.includes(t.id)&&!ua.has(t.id)&&!e.includes(t.id))),ma=(e=[])=>oa.filter((t=>pa.includes(t.id)&&!ua.has(t.id)&&!e.includes(t.id))),_a=oa.reduce(((e,t)=>(e[t.id]=t,e)),{});const ga={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let va;const ya=new Uint8Array(16);function ba(){if(!va&&(va="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!va))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return va(ya)}const wa=[];for(let tt=0;tt<256;++tt)wa.push((tt+256).toString(16).slice(1));function ka(e,t=0){return(wa[e[t+0]]+wa[e[t+1]]+wa[e[t+2]]+wa[e[t+3]]+"-"+wa[e[t+4]]+wa[e[t+5]]+"-"+wa[e[t+6]]+wa[e[t+7]]+"-"+wa[e[t+8]]+wa[e[t+9]]+"-"+wa[e[t+10]]+wa[e[t+11]]+wa[e[t+12]]+wa[e[t+13]]+wa[e[t+14]]+wa[e[t+15]]).toLowerCase()}const Ea=function(e,t,n){if(ga.randomUUID&&!t&&!e)return ga.randomUUID();const r=(e=e||{}).random||(e.rng||ba)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return ka(r)};function Sa(){return Ea().replaceAll("-","")}const Ta="/browser-extension",Ia=`${Ta}/login`,xa=`${Ta}/welcome`,Oa=`${Ta}/uninstall`,Na=`${Sa()}`,Aa=`${Sa()}`,Ra="doubao",La="en-GB";let Ca=function(e){return e.AUTO="auto",e.LIGHT="light",e.DARK="dark",e}({});var Pa;const Ma=(()=>{const e=ms;return e.startsWith("zh")?e:"zh"})();let Da=_s(Ma);Da===La&&(Da="en");let ja=Ma;ja===La&&(ja="en");const Ba={vocabruaryDisableAll:!0,vocabruaryDisableHosts:[],vocabruaryHighlightColor:"rgba(251, 255, 20, 0.44)",vocabruaryOnboarding:!0,videoSubtitleDisableAll:!1,videoSubtitleDisableHosts:[],videoImmersionDisableAll:!1,videoImmersionDisableHosts:[],videoSummaryDisableAll:!1,videoMemoDisableAll:!1,videoMemoDisableHosts:[],videoSummaryDisableHosts:[],podcastSummaryDisableAll:!1,podcastSummaryDisableHosts:[],chatFloatCardDisableAll:!1,chatFloatCardDisableHosts:[],sidebarButtonDisabledAll:!1,sidebarButtonDisabledHosts:[],searchDisabledAll:!1,searchDisabledHosts:[],disableSearchAddonsGlobal:!0,disableSearchAddonsHosts:[],autoTranslatePageHosts:[],disableGlobalGrammar:!g(),disableGrammarHosts:[],InputAssistantDisabledAll:!1,InputAssistantDisabledHosts:[],replyAssistantDisabledAll:!1,replyAssistantDisabledHosts:[],sidebarButtonTop:.5,sidebarButtonPosition:"right",inputAssistantLang:"zh",quickDisabledAll:!1,quickDisabledHosts:[],translateLanguage:Da,autoTranslateSubtitles:!0,subtitleTranslateLang:"system",selectBarOnlyIcon:!1,pageTranslateService:Os.MICROSOFT,selectTranslateService:Os.DOUBAO,pageTranslateShowUnderline:!1,linkPreviewDisabledAll:!1,linkPreviewDisabledHosts:[],hoverTranslateSetting:Ns.NO_TRANSLATE,inputTranslateInfo:{isFirstUse:!0,language:"en",showInputInnerTips:!0,translateService:Os.HUOSHAN,hotKeyCode:As.Space,disableAll:!0},readingPopupActions:{actionList:la(),moreActionList:da()},editingPopupActions:{actionList:ha(),moreActionList:ma()},transPreferConfig:{tipShown:!1,langMap:{}},collectImageDisabledAll:!1,collectImageDisabledHosts:[],socialWebcollectDisabledAll:!1,mediaCardTranslateLanguage:ja,readWebPageCtxConfig:{enabled:!0,hasWebPageContextDialogShow:!0,hasUserSwitched:!1}},Fa=Object.keys(Ba),Ua=l(l({},Ba),{},{uuid:"",installReason:"",synced:!1,authInfo:{isAuthenticated:!1},launchInfo:{},launchConfig:{},abTestValue:{},chatInfo:{},debugInfo:{isEnableDebug:!1,webEnv:"",extEnv:""},requestCommonParams:{},shortcutsConfig:Hs,actions:oa,themeMode:Ca.AUTO,uiLanguage:Ma,voiceSpeaker:{id:"104",style_id:"zh_female_taozi_conversation_v4_wvae_bigtts",name:"\u6e29\u67d4\u6843\u5b50",avatarUrl:""},sidePanelEnabled:!0,hostId:"",PopupListMaxCount:4,onboardingActionRecord:Ss,isSelectbarMoreMenuClicked:!1,needOpenSideBar:!1,featureInfo:null,collectionConfig:{showEntry:!1},tabConversationMap:{},isHistoryChatsClicked:!1,appSettings:Gs,overseaAccessibility:{},doubaoNoticeKey:"",searchUsageTimesInfo:{},voiceSettingTipShown:!1,isArc:!1,dismissUpdateKey:"",navigatorLanguage:(null===(Pa=navigator)||void 0===Pa?void 0:Pa.language)||"",voiceInputShortcutTipShown:!1});let Ga=()=>{};const qa=function(){var e=o((function*(){Ga=yield Es(Ua),Ua.synced=!0}));return function(){return e.apply(this,arguments)}}(),Wa=(e,t,n=!1)=>{const r=Ua[e];return Ua[e]=n?hs(r,t):t,ks.set(e,Ua[e])},za=Wa;function Va(e){return Ua[e]}const Ja=e=>{const t=Va("appSettings")[e];return ps(t,Gs[e])};function Ha(){return Ua.authInfo}function Ka(e,t=!1){Wa("authInfo",e,t)}function $a(){return Ua.debugInfo}function Ya(e,t=!1){Wa("launchInfo",e,t)}function Xa(){return Ua.requestCommonParams}function Qa(e,t=!1){Wa("requestCommonParams",e,t)}class Za{static getInstance(){return Za._instance}init(){void 0===this._hostId&&(this._hostId=Va("hostId"),this._listenBrandInfoMessage(),this._listenStoreMessage(),this._sendHostIdMessage(),this._sendBrandInfo(),this._listenHostIdMessage())}registerRecyclable(e){this._recyclables.push(e)}registerRecyclables(e){e.forEach((e=>{e&&this._recyclables.push(e)}))}registerStore(e,t){this._stores.set(e,t)}getHostId(){return this._hostId}constructor(){c(this,"_recyclables",[]),c(this,"_stores",new Map),c(this,"_hostId",void 0),c(this,"_listenHostIdMessage",(()=>{window.addEventListener("message",this._hostIdMessageHandler)})),c(this,"_listenStoreMessage",(()=>{window.addEventListener("message",this._storeMessageHandler)})),c(this,"_listenBrandInfoMessage",(()=>{window.addEventListener("message",this._brandInfoMessageHandler)})),c(this,"_hostIdMessageHandler",(e=>{var t,n,r,i;void 0!==(null==e||null===(t=e.data)||void 0===t?void 0:t.brand)&&(null==e||null===(n=e.data)||void 0===n?void 0:n.brand)!==Ra||void 0!==(null==e||null===(r=e.data)||void 0===r?void 0:r.hostId)&&(null==e||null===(i=e.data)||void 0===i?void 0:i.hostId)!==this._hostId&&(window.removeEventListener("message",this._hostIdMessageHandler),this._destory())})),c(this,"_brandInfoMessageHandler",(e=>{var t;null!=e&&null!==(t=e.data)&&void 0!==t&&null!==(t=t.extensionReq)&&void 0!==t&&t.requireExtensionInfo&&this._sendBrandInfo(e.origin)})),c(this,"_storeMessageHandler",(e=>{var t,n,r;if(void 0!==(null==e||null===(t=e.data)||void 0===t?void 0:t.brand)&&(null==e||null===(n=e.data)||void 0===n?void 0:n.brand)!==Ra)return;if(void 0===(null==e||null===(r=e.data)||void 0===r?void 0:r.storeData))return;const i=JSON.parse(e.data.storeData);Object.keys(i).forEach((e=>{const t=this._stores.get(e);t&&t.setState(JSON.parse(i[e]))}))})),c(this,"_sendStoreData",(()=>{const e={};this._stores.forEach(((t,n)=>{e[n]=JSON.stringify(t.getState())}));const t=JSON.stringify(e);window.postMessage({storeData:t}),this._stores.clear()}))}_sendHostIdMessage(){window.postMessage({hostId:this._hostId,brand:Ra})}_sendBrandInfo(e="*"){const t={brandName:Ra,version:chrome.runtime.getManifest().version};window.postMessage({extensionRes:t},e)}_destory(){window.removeEventListener("message",this._storeMessageHandler),window.removeEventListener("message",this._brandInfoMessageHandler),this._sendStoreData(),this._recyclables.forEach((e=>{try{"function"==typeof e?e():"function"==typeof(null==e?void 0:e.destory)&&e.destory()}catch(t){fo({message:"\u6267\u884cdestroy\u5931\u8d25",error:t})}})),this._recyclables=[]}}function ec(e){Za.getInstance().registerRecyclable(e)}c(Za,"_instance",new Za);let tc;const nc=()=>tc;function rc(e){const t={};for(const n in e){const r=e[n];M(r)||P(r)?t[n]=r:t[n]=Mr.stringify(r)}return t}const ic=new class{send(e){const{level:t,message:n,eventName:r,meta:i,error:o,action:s}=e;if(null==s||!s.includes(st))return;const a=nc();if("error"===t&&!0===(null==i?void 0:i.reportJsError)){const{metrics:e,categories:t}=j(i||{}),n=o||{};null==a||a.reportCustomEvent({name:r||(null==o?void 0:o.message)||"",metrics:e,categories:l(l({},t),n)})}else if(r){const{metrics:e,categories:t}=j(i||{});null==a||a.reportCustomEvent({name:r,metrics:e,categories:t})}else n&&(null==a||a.log({level:t,content:n,extra:rc(i||{})}))}};(({disableConsole:e,slardarInstance:t,clients:n})=>{if(Yr.disableConsole=e||!1,n)Yr.setClients(n);else if(t){const e=new $r(t);Yr.setClients([e])}})({clients:[ic],disableConsole:!0});const oc=Yr,sc=new $r(Qr);Yr.createLoggerWith({clients:[sc],ctx:{meta:{}}});var ac=n(56488),cc=n.n(ac);function uc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function dc(e,t,n){return t&&lc(e.prototype,t),n&&lc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var fc=[],pc=fc.forEach,hc=fc.slice;var mc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,_c=function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+60*n*1e3)),r&&(i.domain=r),document.cookie=function(e,t,n){var r=n||{};r.path=r.path||"/";var i=encodeURIComponent(t),o="".concat(e,"=").concat(i);if(r.maxAge>0){var s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(s))}if(r.domain){if(!mc.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(r.domain)}if(r.path){if(!mc.test(r.path))throw new TypeError("option path is invalid");o+="; Path=".concat(r.path)}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");o+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o}(e,encodeURIComponent(t),i)},gc=function(e){for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null},vc={name:"cookie",lookup:function(e){var t;if(e.lookupCookie&&"undefined"!=typeof document){var n=gc(e.lookupCookie);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupCookie&&"undefined"!=typeof document&&_c(t.lookupCookie,e,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},yc={name:"querystring",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=n.substring(1).split("&"),i=0;i<r.length;i++){var o=r[i].indexOf("=");if(o>0)r[i].substring(0,o)===e.lookupQuerystring&&(t=r[i].substring(o+1))}}return t}},bc=null,wc=function(){if(null!==bc)return bc;try{bc="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(t){bc=!1}return bc},kc={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&wc()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&wc()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},Ec=null,Sc=function(){if(null!==Ec)return Ec;try{Ec="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(t){Ec=!1}return Ec},Tc={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&Sc()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&Sc()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},Ic={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)t.push(navigator.languages[n]);navigator.userLanguage&&t.push(navigator.userLanguage),navigator.language&&t.push(navigator.language)}return t.length>0?t:void 0}},xc={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},Oc={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},Nc={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,n="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};var Ac=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};uc(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return dc(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=function(e){return pc.call(hc.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(e){return e.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(vc),this.addDetector(yc),this.addDetector(kc),this.addDetector(Tc),this.addDetector(Ic),this.addDetector(xc),this.addDetector(Oc),this.addDetector(Nc)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}})),n=n.map((function(e){return t.options.convertDetectedLanguage(e)})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}]),e}();function Rc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){c(e,t,n[t])}))}return e}function Lc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cc(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Lc(e)}function Pc(e){return Pc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pc(e)}function Mc(e,t){return Mc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mc(e,t)}function Dc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mc(e,t)}Ac.type="languageDetector";var jc={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]}},Bc=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};uc(this,e),this.init(t,n)}return dc(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||jc,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,Rc({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}(),Fc=new Bc,Uc=function(){function e(){uc(this,e),this.observers={}}return dc(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)}));this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function Gc(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function qc(e){return null==e?"":""+e}function Wc(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function zc(e,t,n){var r=Wc(e,t,Object);r.obj[r.k]=n}function Vc(e,t){var n=Wc(e,t),r=n.obj,i=n.k;if(r)return r[i]}function Jc(e,t,n){var r=Vc(e,n);return void 0!==r?r:Vc(t,n)}function Hc(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):Hc(e[r],t[r],n):e[r]=t[r]);return e}function Kc(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var $c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Yc(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return $c[e]})):e}var Xc="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Qc=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return uc(this,e),n=Cc(this,Pc(e).call(this)),Xc&&Uc.call(Lc(n)),n.data=t||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return Dc(e,Uc),dc(e,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[e,t];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split(".")),Vc(this.data,o)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),zc(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=Vc(this.data,s)||{};r?Hc(a,n,i):a=Rc({},a,n),zc(this.data,s,a),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Rc({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),e}(),Zc={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}},eu={},tu=function(){function e(t){var n,r,i,o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return uc(this,e),n=Cc(this,Pc(e).call(this)),Xc&&Uc.call(Lc(n)),r=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i=t,o=Lc(n),r.forEach((function(e){i[e]&&(o[e]=i[e])})),n.options=s,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=Fc.create("translator"),n}return Dc(e,Uc),dc(e,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:i};var s=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(i=s.shift()),e=s.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(t,n,r){var i=this;if("object"!==s(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=this.extractFromKey(t[t.length-1],n),c=a.key,u=a.namespaces,l=u[u.length-1],d=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(f){var p=n.nsSeparator||this.options.nsSeparator;return l+p+c}return c}var h=this.resolve(t,n),m=h&&h.res,_=h&&h.usedKey||c,g=h&&h.exactUsedKey||c,v=Object.prototype.toString.apply(m),y=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&m&&("string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(v)<0&&("string"!=typeof y||"[object Array]"!==v)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(_,m,n):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(o){var w="[object Array]"===v,k=w?[]:{},E=w?g:_;for(var S in m)if(Object.prototype.hasOwnProperty.call(m,S)){var T="".concat(E).concat(o).concat(S);k[S]=this.translate(T,Rc({},n,{joinArrays:!1,ns:u})),k[S]===T&&(k[S]=m[S])}m=k}}else if(b&&"string"==typeof y&&"[object Array]"===v)(m=m.join(y))&&(m=this.extendTranslation(m,t,n,r));else{var I=!1,x=!1,O=void 0!==n.count&&"string"!=typeof n.count,N=e.hasDefaultValue(n),A=O?this.pluralResolver.getSuffix(d,n.count):"",R=n["defaultValue".concat(A)]||n.defaultValue;!this.isValidLookup(m)&&N&&(I=!0,m=R),this.isValidLookup(m)||(x=!0,m=c);var L=N&&R!==m&&this.options.updateMissing;if(x||I||L){if(this.logger.log(L?"updateKey":"missingKey",d,l,c,L?R:m),o){var C=this.resolve(c,Rc({},n,{keySeparator:!1}));C&&C.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var P=[],M=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&M&&M[0])for(var D=0;D<M.length;D++)P.push(M[D]);else"all"===this.options.saveMissingTo?P=this.languageUtils.toResolveHierarchy(n.lng||this.language):P.push(n.lng||this.language);var j=function(e,t,r){i.options.missingKeyHandler?i.options.missingKeyHandler(e,l,t,L?r:m,L,n):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,l,t,L?r:m,L,n),i.emit("missingKey",e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?P.forEach((function(e){i.pluralResolver.getSuffixes(e).forEach((function(t){j([e],c+t,n["defaultValue".concat(t)]||R)}))})):j(P,c,R))}m=this.extendTranslation(m,t,n,h,r),x&&m===c&&this.options.appendNamespaceToMissingKey&&(m="".concat(l,":").concat(c)),x&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(m))}return m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Rc({},n,{interpolation:Rc({},this.options.interpolation,n.interpolation)}));var s,a=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(a){var c=e.match(this.interpolator.nestingRegexp);s=c&&c.length}var u=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(u=Rc({},this.options.interpolation.defaultVariables,u)),e=this.interpolator.interpolate(e,u,n.lng||this.language,n),a){var l=e.match(this.interpolator.nestingRegexp);s<(l&&l.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,f="string"==typeof d?[d]:d;return null!=e&&f&&f.length&&!1!==n.applyPostProcessor&&(e=Zc.handle(f,e,t,this.options&&this.options.postProcessPassResolved?Rc({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var c=s.extractFromKey(e,a),u=c.key;n=u;var l=c.namespaces;s.options.fallbackNS&&(l=l.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,f=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,p=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);l.forEach((function(e){s.isValidLookup(t)||(o=e,!eu["".concat(p[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(eu["".concat(p[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,c,l=u,p=[l];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(p,u,n,e,a);else d&&(o=s.pluralResolver.getSuffix(n,a.count)),d&&f&&p.push(l+o),f&&p.push(l+="".concat(s.options.contextSeparator).concat(a.context)),d&&p.push(l+=o);for(;c=p.pop();)s.isValidLookup(t)||(r=c,t=s.getResource(n,e,c,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}]),e}();function nu(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ru=function(){function e(t){uc(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fc.create("languageUtils")}return dc(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=nu(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=nu(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=nu(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),iu=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ou={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};var su=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};uc(this,e),this.languageUtils=t,this.options=r,this.logger=Fc.create("pluralResolver"),this.rules=(n={},iu.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:ou[e.fc]}}))})),n)}return dc(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var i=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),o=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var s=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),au=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};uc(this,e),this.logger=Fc.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return dc(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:Yc,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Kc(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Kc(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?Kc(t.nestingPrefix):t.nestingPrefixEscaped||Kc("$t("),this.nestingSuffix=t.nestingSuffix?Kc(t.nestingSuffix):t.nestingSuffixEscaped||Kc(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(a.formatSeparator)<0){var i=Jc(t,c,e);return a.alwaysFormat?a.format(i,void 0,n):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),u=o.join(a.formatSeparator).trim();return a.format(Jc(t,c,s),u,n,r)};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?u(a.escape(e)):u(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){if(void 0===(o=l(i[1].trim())))if("function"==typeof d){var n=d(e,i,r);o="string"==typeof n?n:""}else{if(f){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=qc(o));if(e=e.replace(i[0],t.safeValue(o)),t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Rc({},o);function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0],i=(i=this.interpolate(i,s)).replace(/'/g,'"');try{s=JSON.parse(i),t&&(s=Rc({},t,s))}catch(o){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),o),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var c=[],u=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),c=l,u=!0}if((r=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=qc(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),u&&(r=c.reduce((function(e,t){return i.format(e,t,o.lng,o)}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();var cu=function(){function e(t,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return uc(this,e),i=Cc(this,Pc(e).call(this)),Xc&&Uc.call(Lc(i)),i.backend=t,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=Fc.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return Dc(e,Uc),dc(e,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o=[],s=[],a=[],c=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?s.indexOf(a)<0&&s.push(a):(i.state[a]=1,r=!1,s.indexOf(a)<0&&s.push(a),o.indexOf(a)<0&&o.push(a),c.indexOf(t)<0&&c.push(t)))})),r||a.push(e)})),(o.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:r}),{toLoad:o,pending:s,toLoadLanguages:a,toLoadNamespaces:c}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){!function(e,t,n,r){var i=Wc(e,t,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}(n.loaded,[i],o),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,s=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(a,c){a&&c&&i<5?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,c)})):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,Rc({},o,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),e}();function uu(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function lu(){}var du=function(){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(uc(this,e),t=Cc(this,Pc(e).call(this)),Xc&&Uc.call(Lc(t)),t.options=uu(n),t.services={},t.logger=Fc,t.modules={external:[]},r&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,r),Cc(t,Lc(t));setTimeout((function(){t.init(n,r)}),0)}return t}return Dc(e,Uc),dc(e,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=Rc({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===s(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===s(e[2])||"object"===s(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}},this.options,uu(t)),this.format=this.options.interpolation.format,n||(n=lu),!this.options.isClone){this.modules.logger?Fc.init(r(this.modules.logger),this.options):Fc.init(null,this.options);var i=new ru(this.options);this.store=new Qc(this.options.resources,this.options);var o=this.services;o.logger=Fc,o.resourceStore=this.store,o.languageUtils=i,o.pluralResolver=new su(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),o.interpolator=new au(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new cu(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new tu(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&"dev"!==a[0]&&(this.options.lng=a[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var c=Gc(),u=function(){var t=function(t,r){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),c.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),c}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lu,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var i=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(r)o(r);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return o(e)}));this.options.preload&&this.options.preload.forEach((function(e){return o(e)})),this.services.backendConnector.load(i,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(e,t,n){var r=Gc();return e||(e=this.languages),t||(t=this.options.ns),n||(n=lu),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Zc.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=Gc();this.emit("languageChanging",e);var i=function(e){var i="string"==typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t){var n=this,r=function e(t,r){var i;if("object"!==s(r)){for(var o=arguments.length,a=new Array(o>2?o-2:0),c=2;c<o;c++)a[c-2]=arguments[c];i=n.options.overloadTranslationOptionHandler([t,r].concat(a))}else i=Rc({},r);return i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns,n.t(t,i)};return"string"==typeof e?r.lng=e:r.lngs=e,r.ns=t,r}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||(!this.services.backendConnector.backend||!(!s(r,e)||i&&!s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=Gc();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=Gc();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lu,i=Rc({},this.options,n,{isClone:!0}),o=new e(i);return["store","services","language"].forEach((function(e){o[e]=t[e]})),o.services=Rc({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new tu(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}}]),e}();const fu=new du;var pu=function(e,t){return pu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},pu(e,t)};function hu(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}pu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var mu=function(){return mu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mu.apply(this,arguments)};Object.create;function _u(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var gu,vu,yu;Object.create;function bu(e){return e.type===vu.literal}function wu(e){return e.type===vu.argument}function ku(e){return e.type===vu.number}function Eu(e){return e.type===vu.date}function Su(e){return e.type===vu.time}function Tu(e){return e.type===vu.select}function Iu(e){return e.type===vu.plural}function xu(e){return e.type===vu.pound}function Ou(e){return e.type===vu.tag}function Nu(e){return!(!e||"object"!=typeof e||e.type!==yu.number)}function Au(e){return!(!e||"object"!=typeof e||e.type!==yu.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(gu||(gu={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(vu||(vu={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(yu||(yu={}));var Ru=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Lu=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Cu(e){var t={};return e.replace(Lu,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var Pu=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var Mu,Du=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,ju=/^(@+)?(\+|#+)?$/g,Bu=/(\*)(0+)|(#+)(0+)|(0+)/g,Fu=/^(0+)$/;function Uu(e){var t={};return e.replace(ju,(function(e,n,r){return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function Gu(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function qu(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!Fu.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Wu(e){var t=Gu(e);return t||{}}function zu(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=i.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=mu(mu(mu({},t),{notation:"scientific"}),i.options.reduce((function(e,t){return mu(mu({},e),Wu(t))}),{}));continue;case"engineering":t=mu(mu(mu({},t),{notation:"engineering"}),i.options.reduce((function(e,t){return mu(mu({},e),Wu(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Bu,(function(e,n,r,i,o,s){if(n)t.minimumIntegerDigits=r.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(Fu.test(i.stem))t.minimumIntegerDigits=i.stem.length;else if(Du.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Du,(function(e,n,r,i,o,s){return"*"===r?t.minimumFractionDigits=n.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:o&&s?(t.minimumFractionDigits=o.length,t.maximumFractionDigits=o.length+s.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""})),i.options.length&&(t=mu(mu({},t),Uu(i.options[0])))}else if(ju.test(i.stem))t=mu(mu({},t),Uu(i.stem));else{var o=Gu(i.stem);o&&(t=mu(mu({},t),o));var s=qu(i.stem);s&&(t=mu(mu({},t),s))}}return t}var Vu=new RegExp("^"+Ru.source+"*"),Ju=new RegExp(Ru.source+"*$");function Hu(e,t){return{start:e,end:t}}var Ku=!!String.prototype.startsWith,$u=!!String.fromCodePoint,Yu=!!Object.fromEntries,Xu=!!String.prototype.codePointAt,Qu=!!String.prototype.trimStart,Zu=!!String.prototype.trimEnd,el=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},tl=!0;try{tl="a"===(null===(Mu=ul("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Mu?void 0:Mu[0])}catch(Yy){tl=!1}var nl,rl=Ku?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},il=$u?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n,r="",i=e.length,o=0;i>o;){if((n=e[o++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},ol=Yu?Object.fromEntries:function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n],o=i[0],s=i[1];t[o]=s}return t},sl=Xu?function(e,t){return e.codePointAt(t)}:function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,i=e.charCodeAt(t);return i<55296||i>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?i:r-56320+(i-55296<<10)+65536}},al=Qu?function(e){return e.trimStart()}:function(e){return e.replace(Vu,"")},cl=Zu?function(e){return e.trimEnd()}:function(e){return e.replace(Ju,"")};function ul(e,t){return new RegExp(e,t)}if(tl){var ll=ul("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");nl=function(e,t){var n;return ll.lastIndex=t,null!==(n=ll.exec(e)[1])&&void 0!==n?n:""}}else nl=function(e,t){for(var n=[];;){var r=sl(e,t);if(void 0===r||pl(r)||hl(r))break;n.push(r),t+=r>=65536?2:1}return il.apply(void 0,n)};var dl=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var i=this.char();if(123===i){if((o=this.parseArgument(e,n)).err)return o;r.push(o.val)}else{if(125===i&&e>0)break;if(35!==i||"plural"!==t&&"selectordinal"!==t){if(60===i&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(gu.UNMATCHED_CLOSING_TAG,Hu(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&fl(this.peek()||0)){if((o=this.parseTag(e,t)).err)return o;r.push(o.val)}else{var o;if((o=this.parseLiteral(e,t)).err)return o;r.push(o.val)}}else{var s=this.clonePosition();this.bump(),r.push({type:vu.pound,location:Hu(s,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:vu.literal,value:"<"+r+"/>",location:Hu(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(e+1,t,!0);if(i.err)return i;var o=i.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!fl(this.char()))return this.error(gu.INVALID_TAG,Hu(s,this.clonePosition()));var a=this.clonePosition();return r!==this.parseTagName()?this.error(gu.UNMATCHED_CLOSING_TAG,Hu(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:vu.tag,value:r,children:o,location:Hu(n,this.clonePosition())},err:null}:this.error(gu.INVALID_TAG,Hu(s,this.clonePosition())))}return this.error(gu.UNCLOSED_TAG,Hu(n,this.clonePosition()))}return this.error(gu.INVALID_TAG,Hu(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var i=this.tryParseQuote(t);if(i)r+=i;else{var o=this.tryParseUnquoted(e,t);if(o)r+=o;else{var s=this.tryParseLeftAngleBracket();if(!s)break;r+=s}}}var a=Hu(n,this.clonePosition());return{val:{type:vu.literal,value:r,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(fl(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return il.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),il(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(gu.EXPECT_ARGUMENT_CLOSING_BRACE,Hu(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(gu.EMPTY_ARGUMENT,Hu(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(gu.MALFORMED_ARGUMENT,Hu(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(gu.EXPECT_ARGUMENT_CLOSING_BRACE,Hu(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:vu.argument,value:r,location:Hu(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(gu.EXPECT_ARGUMENT_CLOSING_BRACE,Hu(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(gu.MALFORMED_ARGUMENT,Hu(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=nl(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:Hu(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var i,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(s){case"":return this.error(gu.EXPECT_ARGUMENT_TYPE,Hu(o,a));case"number":case"date":case"time":this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition();if((_=this.parseSimpleArgStyleIfPossible()).err)return _;if(0===(f=cl(_.val)).length)return this.error(gu.EXPECT_ARGUMENT_STYLE,Hu(this.clonePosition(),this.clonePosition()));c={style:f,styleLocation:Hu(u,this.clonePosition())}}if((g=this.tryParseArgumentClose(r)).err)return g;var l=Hu(r,this.clonePosition());if(c&&rl(null==c?void 0:c.style,"::",0)){var d=al(c.style.slice(2));if("number"===s)return(_=this.parseNumberSkeletonFromString(d,c.styleLocation)).err?_:{val:{type:vu.number,value:n,location:l,style:_.val},err:null};if(0===d.length)return this.error(gu.EXPECT_DATE_TIME_SKELETON,l);var f={type:yu.dateTime,pattern:d,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?Cu(d):{}};return{val:{type:"date"===s?vu.date:vu.time,value:n,location:l,style:f},err:null}}return{val:{type:"number"===s?vu.number:"date"===s?vu.date:vu.time,value:n,location:l,style:null!==(i=null==c?void 0:c.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var p=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(gu.EXPECT_SELECT_ARGUMENT_OPTIONS,Hu(p,mu({},p)));this.bumpSpace();var h=this.parseIdentifierIfPossible(),m=0;if("select"!==s&&"offset"===h.value){if(!this.bumpIf(":"))return this.error(gu.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Hu(this.clonePosition(),this.clonePosition()));var _;if(this.bumpSpace(),(_=this.tryParseDecimalInteger(gu.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,gu.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return _;this.bumpSpace(),h=this.parseIdentifierIfPossible(),m=_.val}var g,v=this.tryParsePluralOrSelectOptions(e,s,t,h);if(v.err)return v;if((g=this.tryParseArgumentClose(r)).err)return g;var y=Hu(r,this.clonePosition());return"select"===s?{val:{type:vu.select,value:n,options:ol(v.val),location:y},err:null}:{val:{type:vu.plural,value:n,options:ol(v.val),offset:m,pluralType:"plural"===s?"cardinal":"ordinal",location:y},err:null};default:return this.error(gu.INVALID_ARGUMENT_TYPE,Hu(o,a))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(gu.EXPECT_ARGUMENT_CLOSING_BRACE,Hu(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(gu.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Hu(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,r=e.split(Pu).filter((function(e){return e.length>0}));n<r.length;n++){var i=r[n].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],s=i.slice(1),a=0,c=s;a<c.length;a++)if(0===c[a].length)throw new Error("Invalid number skeleton");t.push({stem:o,options:s})}return t}(e)}catch(r){return this.error(gu.INVALID_NUMBER_SKELETON,t)}return{val:{type:yu.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?zu(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var i,o=!1,s=[],a=new Set,c=r.value,u=r.location;;){if(0===c.length){var l=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(gu.EXPECT_PLURAL_ARGUMENT_SELECTOR,gu.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;u=Hu(l,this.clonePosition()),c=this.message.slice(l.offset,this.offset())}if(a.has(c))return this.error("select"===t?gu.DUPLICATE_SELECT_ARGUMENT_SELECTOR:gu.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);"other"===c&&(o=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?gu.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:gu.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Hu(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(e+1,t,n);if(p.err)return p;var h=this.tryParseArgumentClose(f);if(h.err)return h;s.push([c,{value:p.val,location:Hu(f,this.clonePosition())}]),a.add(c),this.bumpSpace(),c=(i=this.parseIdentifierIfPossible()).value,u=i.location}return 0===s.length?this.error("select"===t?gu.EXPECT_SELECT_ARGUMENT_SELECTOR:gu.EXPECT_PLURAL_ARGUMENT_SELECTOR,Hu(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(gu.MISSING_OTHER_CLAUSE,Hu(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var i=!1,o=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;i=!0,o=10*o+(s-48),this.bump()}var a=Hu(r,this.clonePosition());return i?el(o*=n)?{val:o,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=sl(this.message,e);if(void 0===t)throw Error("Offset "+e+" is at invalid UTF-16 code unit boundary");return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(rl(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset "+e+" must be greater than or equal to the current offset "+this.offset());for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset "+e+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&pl(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function fl(e){return e>=97&&e<=122||e>=65&&e<=90}function pl(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function hl(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function ml(e){e.forEach((function(e){if(delete e.location,Tu(e)||Iu(e))for(var t in e.options)delete e.options[t].location,ml(e.options[t].value);else ku(e)&&Nu(e.style)||(Eu(e)||Su(e))&&Au(e.style)?delete e.style.location:Ou(e)&&ml(e.children)}))}function _l(e,t){void 0===t&&(t={}),t=mu({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new dl(e,t).parse();if(n.err){var r=SyntaxError(gu[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||ml(n.val),n.val}function gl(e,t){var n=t&&t.cache?t.cache:Tl,r=t&&t.serializer?t.serializer:kl;return(t&&t.strategy?t.strategy:wl)(e,{cache:n,serializer:r})}function vl(e,t,n,r){var i,o=null==(i=r)||"number"==typeof i||"boolean"==typeof i?r:n(r),s=t.get(o);return void 0===s&&(s=e.call(this,r),t.set(o,s)),s}function yl(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return void 0===o&&(o=e.apply(this,r),t.set(i,o)),o}function bl(e,t,n,r,i){return n.bind(t,e,r,i)}function wl(e,t){return bl(e,this,1===e.length?vl:yl,t.cache.create(),t.serializer)}var kl=function(){return JSON.stringify(arguments)};function El(){this.cache=Object.create(null)}El.prototype.has=function(e){return e in this.cache},El.prototype.get=function(e){return this.cache[e]},El.prototype.set=function(e,t){this.cache[e]=t};var Sl,Tl={create:function(){return new El}},Il={variadic:function(e,t){return bl(e,this,yl,t.cache.create(),t.serializer)},monadic:function(e,t){return bl(e,this,vl,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(Sl||(Sl={}));var xl,Ol=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.code=n,i.originalMessage=r,i}return hu(t,e),t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error),Nl=function(e){function t(t,n,r,i){return e.call(this,'Invalid values for "'+t+'": "'+n+'". Options are "'+Object.keys(r).join('", "')+'"',Sl.INVALID_VALUE,i)||this}return hu(t,e),t}(Ol),Al=function(e){function t(t,n,r){return e.call(this,'Value for "'+t+'" must be of type '+n,Sl.INVALID_VALUE,r)||this}return hu(t,e),t}(Ol),Rl=function(e){function t(t,n){return e.call(this,'The intl string context variable "'+t+'" was not provided to the string "'+n+'"',Sl.MISSING_VALUE,n)||this}return hu(t,e),t}(Ol);function Ll(e){return"function"==typeof e}function Cl(e,t,n,r,i,o,s){if(1===e.length&&bu(e[0]))return[{type:xl.literal,value:e[0].value}];for(var a=[],c=0,u=e;c<u.length;c++){var l=u[c];if(bu(l))a.push({type:xl.literal,value:l.value});else if(xu(l))"number"==typeof o&&a.push({type:xl.literal,value:n.getNumberFormat(t).format(o)});else{var d=l.value;if(!i||!(d in i))throw new Rl(d,s);var f=i[d];if(wu(l))f&&"string"!=typeof f&&"number"!=typeof f||(f="string"==typeof f||"number"==typeof f?String(f):""),a.push({type:"string"==typeof f?xl.literal:xl.object,value:f});else if(Eu(l)){var p="string"==typeof l.style?r.date[l.style]:Au(l.style)?l.style.parsedOptions:void 0;a.push({type:xl.literal,value:n.getDateTimeFormat(t,p).format(f)})}else if(Su(l)){p="string"==typeof l.style?r.time[l.style]:Au(l.style)?l.style.parsedOptions:void 0;a.push({type:xl.literal,value:n.getDateTimeFormat(t,p).format(f)})}else if(ku(l)){(p="string"==typeof l.style?r.number[l.style]:Nu(l.style)?l.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),a.push({type:xl.literal,value:n.getNumberFormat(t,p).format(f)})}else{if(Ou(l)){var h=l.children,m=l.value,_=i[m];if(!Ll(_))throw new Al(m,"function",s);var g=_(Cl(h,t,n,r,i,o).map((function(e){return e.value})));Array.isArray(g)||(g=[g]),a.push.apply(a,g.map((function(e){return{type:"string"==typeof e?xl.literal:xl.object,value:e}})))}if(Tu(l)){if(!(v=l.options[f]||l.options.other))throw new Nl(l.value,f,Object.keys(l.options),s);a.push.apply(a,Cl(v.value,t,n,r,i))}else if(Iu(l)){var v;if(!(v=l.options["="+f])){if(!Intl.PluralRules)throw new Ol('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Sl.MISSING_INTL_API,s);var y=n.getPluralRules(t,{type:l.pluralType}).select(f-(l.offset||0));v=l.options[y]||l.options.other}if(!v)throw new Nl(l.value,f,Object.keys(l.options),s);a.push.apply(a,Cl(v.value,t,n,r,i,f-(l.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===xl.literal&&t.type===xl.literal?n.value+=t.value:e.push(t),e}),[])}(a)}function Pl(e,t){return t?Object.keys(e).reduce((function(n,r){var i,o;return n[r]=(i=e[r],(o=t[r])?mu(mu(mu({},i||{}),o||{}),Object.keys(i).reduce((function(e,t){return e[t]=mu(mu({},i[t]),o[t]||{}),e}),{})):i),n}),mu({},e)):e}function Ml(e){return{create:function(){return{has:function(t){return t in e},get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(xl||(xl={}));var Dl=function(){function e(t,n,r,i){var o=this;if(void 0===n&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=o.formatToParts(e);if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===xl.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return Cl(o.ast,o.locales,o.formatters,o.formats,e,void 0,o.message)},this.resolvedOptions=function(){return{locale:Intl.NumberFormat.supportedLocalesOf(o.locales)[0]}},this.getAst=function(){return o.ast},"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:null==i?void 0:i.ignoreTag})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Pl(e.formats,r),this.locales=n,this.formatters=i&&i.formatters||function(e){return void 0===e&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:gl((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.NumberFormat).bind.apply(e,_u([void 0],t)))}),{cache:Ml(e.number),strategy:Il.variadic}),getDateTimeFormat:gl((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.DateTimeFormat).bind.apply(e,_u([void 0],t)))}),{cache:Ml(e.dateTime),strategy:Il.variadic}),getPluralRules:gl((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.PluralRules).bind.apply(e,_u([void 0],t)))}),{cache:Ml(e.pluralRules),strategy:Il.variadic})}}(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.__parse=_l,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const jl=Dl;var Bl,Fl=function(){return Fl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Fl.apply(this,arguments)};function Ul(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}void 0===n&&(n=null);for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=e[s]}return i()?{}:{obj:e,k:r(o.shift())}}!function(e){e.keepRaw="keepRaw",e.replaceAnyway="replaceAnyway"}(Bl||(Bl={}));Bl.replaceAnyway;var Gl={memoize:!1,memoizeFallback:!1,bindI18n:!1,bindI18nStore:!1,onParseError:Bl.replaceAnyway},ql=function(){function e(){this.mem={}}return e.staticInit=function(t){e._i18nextInstance=t},e.prototype.init=function(t,n){var r=this;void 0===t&&(t=e._i18nextInstance);var i={};if((null==t?void 0:t.options)&&(t.options.i18nFormat&&(i=t.options.i18nFormat),i.onParseError=t.options.onParseError,i.missingInterpolationHandler=t.options.missingInterpolationHandler,i.icuConfig=t.options.icuConfig,i.ignoreWarning=!!t.options.ignoreWarning),this.options=Object.assign(Gl,n,i),this.formats=this.options.formats,t){var o=this.options,s=o.bindI18n,a=o.bindI18nStore,c=o.memoize;t.IntlMessageFormat=jl,this.IntlMessageFormat=jl,t.ICU=this,c&&(s&&t.on(s,(function(){return r.clearCache()})),a&&t.store.on(a,(function(){return r.clearCache()})))}this.options.localeData&&("[object Array]"===Object.prototype.toString.apply(this.options.localeData)?this.options.localeData.forEach((function(e){return r.addLocaleData(e)})):this.addLocaleData(this.options.localeData))},e.prototype.addLocaleData=function(e){("[object Array]"===Object.prototype.toString.apply(e)?e:[e]).forEach((function(e){e&&e.locale&&jl.__addLocaleData(e)}))},e.prototype.addUserDefinedFormats=function(e){this.formats=this.formats?Fl(Fl({},this.formats),e):e},e.prototype.checkMissingInterpolation=function(e,t,n,r,i){if(!1===(this.options.icuConfig||{}).strict)return n;for(var o={},s=0,a=e;s<a.length;s++){var c=a[s];if(1===c.type){var u=c.value;if(null===n[u]||void 0===n[u]){if("function"==typeof this.options.missingInterpolationHandler){var l=this.options.missingInterpolationHandler({key:i,text:t,locale:r,interpolation:{key:u,val:n[u]}});if("string"==typeof l){o[u]=l;continue}}switch(this.options.onParseError){case Bl.keepRaw:throw new Error;case Bl.replaceAnyway:o[u]="{"+u+"}";continue}if("function"==typeof this.options.onParseError){var d=this.options.onParseError(t,u,r,this.IntlMessageFormat);if(!0===d)throw new Error;o[u]="string"==typeof d?d:"{"+u+"}"}else this.options.ignoreWarning,o[u]="{"+u+"}"}}}return Object.assign({},n,o)},e.prototype.parse=function(e,t,n,r,i,o){var s,a=o&&o.resolved&&o.resolved.res,c=this.options.memoize&&n+"."+r+"."+i.replace(/\./g,"###");!a&&t.thirdParamFallback&&t.fallbackText&&(e=t.fallbackText),this.options.memoize&&(s=function(e,t){var n=Ul(e,t),r=n.obj,i=n.k;if(r)return r[i]}(this.mem,c));try{return s||(s=new this.IntlMessageFormat(e,n,this.formats,(this.options.icuConfig||{}).formatOptions),this.options.memoize&&(this.options.memoizeFallback||!o||a)&&function(e,t,n){var r=Ul(e,t,Object);r.obj[r.k]=n}(this.mem,c,s)),s.format(this.checkMissingInterpolation(s.getAst(),e,t||{},n,i))}catch(u){return e}},e.prototype.addLookupKeys=function(e,t,n,r,i){return e},e.prototype.clearCache=function(){this.mem={}},e.type="i18nFormat",e._i18nextInstance=null,e}(),Wl=(ql.name,function(){return Wl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Wl.apply(this,arguments)}),zl=/^\s*\[\[__starling_(\d+)_(.*)__\]\]\s*$/;"undefined"!=typeof window&&(window.__STARLING_INCONTEXT_GLOBAL__HOOK__=Wl({},window.__STARLING_INCONTEXT_GLOBAL__HOOK__||{payload:{}}));var Vl={name:"inContext",type:"postProcessor",process:function(e,t,n,r){if(window&&document.getElementById("INCONTEXT-KEY-MATCH")&&!n.__STARLING_INCONTEXT_FLAG__){window.__STARLING_INCONTEXT_GLOBAL_I18N__||(window.__STARLING_INCONTEXT_GLOBAL_I18N__=r),delete n.keySeparator,delete n.lngs;var i=0;if(t=t.toString(),zl.test(t))(o=t.match(zl))[0],i=o[1],t=o[2];if(zl.test(e)){var o;(o=e.match(zl))[0];o[1];e=o[2]}if(window.__STARLING_INCONTEXT_GLOBAL__HOOK__.payload[t]){var s=window.__STARLING_INCONTEXT_GLOBAL__HOOK__.payload[t].findIndex((function(e){return JSON.stringify(e.options)===JSON.stringify(n)}));s>-1?(window.__STARLING_INCONTEXT_GLOBAL__HOOK__.payload[t][s].default=e,i=s):i=window.__STARLING_INCONTEXT_GLOBAL__HOOK__.payload[t].push({options:n,default:e})-1}else window.__STARLING_INCONTEXT_GLOBAL__HOOK__.payload[t]=[{options:n,default:e}],i=0;return"[[__starling_"+i+"_"+t+"__]]"}return e}};function Jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kl(e,t,n){return t&&Hl(e.prototype,t),n&&Hl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $l(e){return function(e){if(Array.isArray(e))return Xl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Yl(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yl(e,t){if(e){if("string"==typeof e)return Xl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xl(e,t):void 0}}function Xl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}for(var Ql=["AFN","EUR","ALL","DZD","USD","AOA","XCD","ARS","AMD","AWG","AUD","AZN","BSD","BHD","BDT","BBD","BYN","BZD","XOF","BMD","INR","BTN","BOB","BOV","BAM","BWP","NOK","BRL","BND","BGN","BIF","CVE","KHR","XAF","CAD","KYD","CLP","CLF","CNY","COP","COU","KMF","CDF","NZD","CRC","HRK","CUP","CUC","ANG","CZK","DKK","DJF","DOP","EGP","SVC","ERN","ETB","FKP","FJD","XPF","GMD","GEL","GHS","GIP","GTQ","GBP","GNF","GYD","HTG","HNL","HKD","HUF","ISK","IDR","XDR","IRR","IQD","ILS","JMD","JPY","JOD","KZT","KES","KPW","KRW","KWD","KGS","LAK","LBP","LSL","ZAR","LRD","LYD","CHF","MOP","MKD","MGA","MWK","MYR","MVR","MRO","MUR","XUA","MXN","MXV","MDL","MNT","MAD","MZN","MMK","NAD","NPR","NIO","NGN","OMR","PKR","PAB","PGK","PYG","PEN","PHP","PLN","QAR","RON","RUB","RWF","SHP","WST","STD","SAR","RSD","SCR","SLL","SGD","XSU","SBD","SOS","SSP","LKR","SDG","SRD","SZL","SEK","CHE","CHW","SYP","TWD","TJS","TZS","THB","TOP","TTD","TND","TRY","TMT","UGX","UAH","AED","USN","UYU","UYI","UZS","VUV","VEF","VND","YER","ZMW","ZWL","XBA","XBB","XBC","XBD","XTS","XXX","XAU","XPD","XPT","XAG"],Zl={},ed=0;ed<Ql.length;ed++)Zl[Ql[ed]]={style:"currency",currency:Ql[ed]};var td={number:Zl},nd="languageTransformer";function rd(e){return function(t){return t.type===e}}function id(e,t){var n=e;return(t||[]).map((function(t){n=t.process(e)||n})),n}var od,sd={lng:"zh-CN",fallbackLng:["en-US"],inContext:!0},ad=[ql,Vl],cd=function(){function e(t,n){Jl(this,e),this._waitingToAddResourceBundle=[],null!=t&&t.copiedI18nextInstance?this.instance=t.copiedI18nextInstance:(this._handlePlugins(n),this._handleConfigs(t),this.instance=fu.createInstance(),this.instance.isInitialized=!1)}return Kl(e,[{key:"_handlePlugins",value:function(e){var t,n;!1===(null===(t=this.config)||void 0===t||null===(n=t.icuConfig)||void 0===n?void 0:n.open)&&ad.shift(),this.plugins=Array.isArray(e)?e.concat(ad):ad}},{key:"_handleConfigs",value:function(e){this.userLng=(null==e?void 0:e.lng)||null,this.config=Object.assign({},sd,e||{})}},{key:"language",get:function(){return(this.instance||{}).language}},{key:"createInstance",value:function(){var e=this;return new Promise((function(t,n){"undefined"!=typeof window&&!window.CocosEngine&&e.config.inContext&&(e.config.postProcess=[].concat(["inContext"],e.config.postProcess||[]),window.__STARLING_DEVTOOLS_I18N=e.instance),e.plugins.map((function(t){"IES_INTL_ICU_PLUGIN"===t.name&&t.staticInit(e.instance),e.instance.use(t)}));var r=e.config;e.config.formats=Object.assign({},e.config.formats,td);var i=id(r.lng,e.plugins.filter(rd(nd)));e.instance.init(Object.assign({},r,{lng:i,i18nFormat:{formats:e.config.formats}}),(function(r,i){try{var o,s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Yl(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}(e._waitingToAddResourceBundle);try{for(s.s();!(o=s.n()).done;){var a,c=o.value;(a=e.instance).addResourceBundle.apply(a,$l(c))}}catch(r){s.e(r)}finally{s.f()}e._waitingToAddResourceBundle=[]}catch(r){}r||(e._updateLanguages(),t({t:i,err:r})),e.init=!0,n({t:i,err:r})}))}))}},{key:"_updateLanguages",value:function(){this.languages=this.instance?Array.from(new Set([this.instance.language].concat($l(this.instance.languages)))):null}},{key:"getLanguages",value:function(){return this.languages}},{key:"changeLanguage",value:function(e,t){var n=this;this.config.lng=e,this.instance.changeLanguage(e,(function(e,r){e||n._updateLanguages(),t&&t(e,r)}))}},{key:"changeLanguageWithPromise",value:function(e){var t=this;return new Promise((function(n,r){t.config.lng=e,t.instance.changeLanguage(e,(function(e,i){e&&r({err:e,t:i}),t._updateLanguages(),n({err:e,t:i})}))}))}},{key:"getDir",value:function(e){return this.instance.dir(e)}},{key:"t",value:function(e,t,n){var r=Array.isArray(e)?Array.from(e).map((function(){return" "})).join(""):Array(e.length).fill(" "),i=Object.assign({keySeparator:r,nsSeparator:r},t);return"thirdParamFallback"in this.config&&this.config.thirdParamFallback&&(i.thirdParamFallback=!0),this.instance.t(e,n,i)}},{key:"addResourceBundle",value:function(e,t,n,r,i){return this.instance.isInitialized?this.instance.addResourceBundle(e,t,n,r,i):(this._waitingToAddResourceBundle.push([e,t,n,!!r,!!i]),this.instance)}},{key:"cloneInstance",value:function(t,n){var r=this.instance.cloneInstance(t,n),i=new e({copiedI18nextInstance:r});return i.t=this.t.bind(i),i.config=this.config,i.plugins=this.plugins,i.languages=this.languages,i.init=r.isInitialized||Boolean(this.init),i.userLng=this.userLng,r.on("initialized",(function(){i.init=!0})),i}}]),e}(),ud="Starling_intl:",ld=function(){for(var e,t="".concat(ud," [WARNING]"),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];(e=console).warn.apply(e,[t].concat(r))},dd=function(){for(var e,t="".concat(ud," [ERROR]"),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];(e=console).error.apply(e,[t].concat(r))};function fd(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function pd(){}function hd(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}!function(e){e.intl3rdParty="intl3rdParty",e.backend="backend",e.logger="logger",e.languageDetector="languageDetector",e.postProcessor="postProcessor",e.i18nFormat="i18nFormat",e["3rdParty"]="3rdParty"}(od||(od={}));var md=null,_d=function(){function e(t){var n;Jl(this,e),this.plugins=[],this.i18nInstance=null!==(n=null==t?void 0:t.i18nInstance)&&void 0!==n?n:new cd}return Kl(e,[{key:"use",value:function(e){return this.plugins.includes(e)?(ld("Plugin: ".concat(e.name," has beeninit installed.")),this):(this.plugins.push(e),this)}},{key:"init",value:function(e,t){try{var n=this;return n.ignoreWarning=e.ignoreWarning,n.i18nInstance._handleConfigs(e),n.i18nInstance._handlePlugins(n.plugins),fd(function(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}((function(){return fd(n.i18nInstance.createInstance(),(function(e){var r,i=e.err,o=e.t,s=n.plugins.filter((function(e){return e.type===od.intl3rdParty}));return fd((r=s.map(hd((function(e){if(e&&"function"==typeof e.init){var t=e.init instanceof Promise?e.init:hd((function(t){return Promise.resolve(e.init(t))}));return function(e,t){if(!t)return e&&e.then?e.then(pd):Promise.resolve()}(t(n))}}))),new Promise((function(e,t){if(Array.isArray(r)||(r=Array.from(r)),r.length<=0)return e([]);var n=[];r=r.map((function(i,o){return function(){("function"==typeof i?new Promise(i):Promise.resolve(i)).then((function(t){n[o]=t,o===r.length-1?e(n):r[o+1]()}),t)}})),r[0]()}))),(function(){return"function"==typeof t&&t(i,o),{err:i,t:o}}))}))}),(function(e){return dd("The instance init error: ".concat(e)),{err:e,t:function(e){return e}}})))}catch(r){return Promise.reject(r)}}},{key:"language",get:function(){return(this.i18nInstance||{}).language}},{key:"setLang",value:function(e,t){var n=id(e,this.plugins.filter(rd(nd)));this.i18nInstance.changeLanguage(n,t)}},{key:"getLanguages",value:function(){return this.i18nInstance.getLanguages()}},{key:"setLangWithPromise",value:function(e){var t=id(e,this.plugins.filter(rd(nd)));return this.i18nInstance.changeLanguageWithPromise(t)}},{key:"dir",value:function(e){return this.i18nInstance.getDir(e)}},{key:"t",value:function(e,t,n){var r=null;return(r=void 0===this?md:this).ignoreWarning||r.i18nInstance&&r.i18nInstance.init?!e||"string"==typeof e&&!e.trim()?"":r.i18nInstance.t(e,t,n):(dd("The instance has not been initialized: i18n.t('".concat(e,"'").concat(t?","+JSON.stringify(t):"",");")),null!=n?n:Array.isArray(e)?e[0]:e)}},{key:"addResourceBundle",value:function(e,t,n,r,i){return this.i18nInstance.addResourceBundle(e,t,n,r,i)}},{key:"cloneInstance",value:function(t){var n=this.i18nInstance.cloneInstance(t),r=new e({i18nInstance:n});return r.t=this.t.bind(r),r.plugins=this.plugins,r.ignoreWarning=this.ignoreWarning,r}}]),e}();md=new _d;var gd=new _d,vd=n(11855),yd=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,bd={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xa9","&#169;":"\xa9","&reg;":"\xae","&#174;":"\xae","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},wd=function(e){return bd[e]};function kd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ed(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kd(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Sd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(yd,wd)}};(0,vd.createContext)();!function(){function e(){uc(this,e),this.usedNamespaces={}}dc(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}])}();var Td={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Sd=Ed(Ed({},Sd),e)}(e.options.react),function(e){e}(e)}};const Id={order:["navigator","htmlTag","path","subdomain"],caches:[]},xd=e=>{let t=e;return t===ms&&"undefined"!=typeof navigator&&(t=navigator.language),_s(t)};function Od(){return(Od=o((function*(e){const t=xd(Va("uiLanguage"));yield gd.use(cc()).use(Ac).use(Td).init({fallbackLng:"en",debug:!1,ns:["web"],resources:(null==e?void 0:e.resources)||window.__cici_extension_i18n_resources__,detection:Id,interpolation:{escapeValue:!1},lng:t,defaultNS:"web"});const n={uiLanguage:e=>{gd.setLang(xd(e.newValue))},navigatorLanguage:()=>{Va("uiLanguage")===ms&&gd.setLang(xd(Va("uiLanguage")))}};ks.watch(n),null!=e&&e.isBackground||!window||window.addEventListener("languagechange",(()=>{za("navigatorLanguage",navigator.language)})),ec((()=>{ks.unwatch(n)}))}))).apply(this,arguments)}const Nd="undefined"!=typeof window?window:self;performance.timeOrigin.toString(36);function Ad(e="en"){var t;return null!==(t=_s(Va("uiLanguage")).replace(/-.*$/,""))&&void 0!==t?t:e}const Rd=()=>{const{ttWid:e,webId:t=""}=Xa();return e?t:"0"},Ld=()=>{var e;const{country:t,teaWebId:n,teaUuid:r}=Xa();return{version:"1.13.1",version_code:20650,language:Ad(),browser_language:navigator.language,device_platform:"web",aid:Ls,pkg_type:Bs,device_id:Rd(),web_id:null!==(e=null!=n?n:r)&&void 0!==e?e:"0",is_new_user:"0",region:t,sys_region:t,"use-olympus-account":1,samantha_web:"1",real_aid:Ls||""}},Cd=()=>{const e={},{isEnableDebug:t,extEnv:n}=$a();return t&&n&&(e["x-tt-env"]=n,e["x-use-ppe"]="1"),e};let Pd=function(e){return e[e.UNKNOWN_ERROR=1]="UNKNOWN_ERROR",e[e.SHARK_BLOCKED=710022002]="SHARK_BLOCKED",e[e.COUNTRY_RESTRICTED=710022017]="COUNTRY_RESTRICTED",e[e.CONTENT_UNAVAILABLE=710012005]="CONTENT_UNAVAILABLE",e[e.NOACCESS=710012e3]="NOACCESS",e[e.NO_PERMISSION=710020101]="NO_PERMISSION",e[e.BAD_REQUEST=710020201]="BAD_REQUEST",e[e.INVALID_PARAMS=710020202]="INVALID_PARAMS",e[e.USER_INVALID=710022e3]="USER_INVALID",e[e.SYSTEM_ERROR=710020702]="SYSTEM_ERROR",e[e.SYSTEM_ERROR2=710022001]="SYSTEM_ERROR2",e[e.NOT_LOGIN=710012001]="NOT_LOGIN",e[e.NO_INNER_SSO_TOKEN=710012006]="NO_INNER_SSO_TOKEN",e[e.LIMIT_TO_SEND_MESSAGE=710022004]="LIMIT_TO_SEND_MESSAGE",e[e.BOT_INVALID=710022005]="BOT_INVALID",e[e.BOT_BANNED=710022010]="BOT_BANNED",e[e.BOT_REVIEWING=710022011]="BOT_REVIEWING",e[e.CONVERSATION_INVALID=710022006]="CONVERSATION_INVALID",e[e.NEED_TO_WAIT=710012007]="NEED_TO_WAIT",e[e.CLEAR_LAST_PROMPT=710022008]="CLEAR_LAST_PROMPT",e[e.USER_BANNED=710012008]="USER_BANNED",e[e.USER_BAN_RELEASED=710012009]="USER_BAN_RELEASED",e[e.USER_BAN_APPEALING=710012011]="USER_BAN_APPEALING",e[e.USER_BAN_APPEAL_FAILED=710012010]="USER_BAN_APPEAL_FAILED",e[e.NETWORK_TIMEOUT=710010701]="NETWORK_TIMEOUT",e[e.MYSQL_ERROR=710020801]="MYSQL_ERROR",e[e.PARAMS_VALID_FAILED=710020203]="PARAMS_VALID_FAILED",e[e.REDIS_ERROR=710020803]="REDIS_ERROR",e[e.USER_NO_AUTH_USE_BOT=710012012]="USER_NO_AUTH_USE_BOT",e[e.USER_NOT_EXISTED=710012014]="USER_NOT_EXISTED",e[e.OPEN_AUTH_INVALID=710012020]="OPEN_AUTH_INVALID",e[e.IMAGE_SAFETY_ERROR=710025003]="IMAGE_SAFETY_ERROR",e[e.FILE_SAFETY_ERROR=710025004]="FILE_SAFETY_ERROR",e[e.CONVERSATION_MESSAGE_OVER_LIMIT=710018001]="CONVERSATION_MESSAGE_OVER_LIMIT",e[e.CONVERSATION_UNDER_REVIEW=710018002]="CONVERSATION_UNDER_REVIEW",e[e.CONVERSATION_SHARE_DELETED=710018003]="CONVERSATION_SHARE_DELETED",e[e.GUEST_REACH_LIMIT=710022013]="GUEST_REACH_LIMIT",e[e.GUEST_CONVERSATION_REACH_LIMIT=710022022]="GUEST_CONVERSATION_REACH_LIMIT",e[e.COLLECTION_DELETED=710027003]="COLLECTION_DELETED",e[e.INVALID_MUSIC_SHARING=710019001]="INVALID_MUSIC_SHARING",e[e.SECURITY_RESOURCE_REJECTED=671020001]="SECURITY_RESOURCE_REJECTED",e}({}),Md=[];const Dd=e=>{try{Md.forEach((t=>null==t?void 0:t.postMessage(e)))}catch(t){fo("[lwx] send log to port error",t)}};function jd(e,t={}){const n=e.includes("?"),r=Object.keys(t).reduce(((e,n)=>{const r=void 0===t[n]||null===t[n]?"":String(t[n]);return e=`${e}&${`${encodeURIComponent(n)}=${encodeURIComponent(r)}`}`}),"");return n?`${e}${r}`:`${e}?${r.replace(/^&/,"")}`}function Bd(e,t={},n){const{isEnableDebug:r,webEnv:i}=$a(),o=l({from:"ext",extId:encodeURIComponent(chrome.runtime.id)},t);return n&&!o.extra&&(o.extra=btoa(JSON.stringify(n))),r&&i&&(o["x-flow-env"]=i),jd(`https://${Rs}${e}`,o)}function Fd(){const{hostname:e}=window.location;return!!e.startsWith("youtube.com")||e.indexOf(".youtube.com")>0}function Ud(){const{hostname:e}=window.location;return!!e.startsWith("bilibili.com")||e.indexOf(".bilibili.com")>0}const Gd=e=>{const t=new URLSearchParams;for(const n in e){const r=e[n];t.append(n,String(r))}return t.toString()};const qd=class extends Oo{constructor(e){super(e),c(this,"handleError",(e=>{try{var t,n,r,i;if(null==e||!e.reason)return;const o=(null==e?void 0:e.fileName)||"unknown",s=0,a=`${null==e||null===(t=e.reason)||void 0===t?void 0:t.message}\n   at ? (${o}:${s})`,c=(null==e||null===(n=e.reason)||void 0===n?void 0:n.stack)||a,u="string"==typeof(null==e?void 0:e.reason)?null==e?void 0:e.reason:null!==(r=JSON.stringify(null==e?void 0:e.reason))&&void 0!==r?r:"Unspecified reason";null!==(i=e.reason.config)&&void 0!==i&&i.url&&(this.url=e.reason.config.url),this.stack=c,this.msg=u,this.recordError({name:ti.PROMISE_ERROR})}catch(o){fo(o)}})),this.run()}run(){self.addEventListener("unhandledrejection",this.handleError,!0)}destroy(){self.removeEventListener("unhandledrejection",this.handleError)}};class Wd extends Oo{constructor(e){super(e),this.run()}run(){self.onerror=(e,t,n,r,i)=>{try{this.msg=JSON.stringify(e),this.url=t||"",this.line=n||0,this.col=r||0,this.errorName=(null==i?void 0:i.name)||"",this.stack=(null==i?void 0:i.stack)||"",this.recordError({name:ti.JS_ERROR})}catch(i){fo("js\u9519\u8bef\u5f02\u5e38",i)}}}destroy(){self.onerror=null}}const zd=class extends Oo{constructor(e){super(e.region),c(this,"rule",void 0),this.run(),this.rule=e.rule}run(){const e=self,t=this,n=e.fetch;e.fetch=function(...e){return new Promise(((r,i)=>{var o;const s=[null==e||null===(o=e[0])||void 0===o?void 0:o.replace("#skipBGMonitor=true",""),...null==e?void 0:e.slice(1)];n.apply(this,s).then((e=>{var n;const i=e.headers.get("x-tt-logid");t.msg=`Network error ${null==e?void 0:e.status}`,t.url=e.url||"",t.statusCode=(null==e?void 0:e.status)||0,t.logId=i||"",/^2\d{2}$/.test(null==e||null===(n=e.status)||void 0===n?void 0:n.toString())||t.recordError({name:ti.FETCH_ERROR}),r(e)})).catch((e=>i(e)))}))}}};const Vd=class extends Oo{constructor(e,t){super(e,t),c(this,"injectTabIds",void 0),c(this,"removeTabId",(e=>{var t;this.injectTabIds.has(e)&&(clearTimeout(null===(t=this.injectTabIds.get(e))||void 0===t?void 0:t.timer),this.injectTabIds.delete(e))})),c(this,"clearTimeId",(e=>{var t;void 0!==e&&this.injectTabIds.has(e)&&(clearTimeout(null===(t=this.injectTabIds.get(e))||void 0===t?void 0:t.timer),this.injectTabIds.set(e,l(l({},this.injectTabIds.get(e)),{},{timer:null,active:!1})))})),c(this,"clearAllTimers",(()=>{this.injectTabIds.forEach(((e,t)=>{clearTimeout(null==e?void 0:e.timer),this.injectTabIds.set(t,l(l({},e),{},{timer:null,active:!1}))}))})),c(this,"start",(()=>{try{this.clearAllTimers();const e=this;chrome.tabs.query({active:!0},(t=>{t.forEach((t=>{null!=t&&t.id&&this.injectTabIds.has(null==t?void 0:t.id)&&e.sendHeartBeat(t,0)}))}))}catch(e){fo(e)}})),c(this,"sendHeartBeat",((e,t=0)=>{let n=t;if(null!=e&&e.id&&this.injectTabIds.has(null==e?void 0:e.id)){var r;this.clearTimeId(null==e?void 0:e.id),Number(new Date)-((null===(r=this.injectTabIds.get(null==e?void 0:e.id))||void 0===r?void 0:r.lastTimestamp)||Number(new Date))>8e3&&(this.updateActiveTime(null==e?void 0:e.id),n++),this.crashLog&&lo("HEARTBEAT_ALIVE_TAB~~~~~~~~~~~",null==e?void 0:e.id),this.crashLog&&lo(this.injectTabIds);try{var i;Eo({tabId:null==e?void 0:e.id,name:"crash-monitor-message",body:{type:eo,tabId:null==e?void 0:e.id}}).then((e=>{if(e.success){const{type:t,tabId:n}=e.data||{};t===Zi&&this.updateActiveTime(n),t===to&&this.removeTabId(n)}})),this.injectTabIds.set(null==e?void 0:e.id,{timer:setTimeout((()=>{var t;n>=2?this.stopHeartBeatAndReport((null==e?void 0:e.id)||0):(this.crashLog&&lo("curRetryCount:",n),void 0!==(null==e?void 0:e.id)&&null!==(t=this.injectTabIds.get(null==e?void 0:e.id))&&void 0!==t&&t.active&&this.sendHeartBeat(e,n))}),5e3),lastTimestamp:(null===(i=this.injectTabIds.get(null==e?void 0:e.id))||void 0===i?void 0:i.lastTimestamp)||Number(new Date),tabInfo:e,active:!0})}catch(o){fo(o)}}})),c(this,"updateActiveTime",(e=>{void 0!==e&&this.injectTabIds.has(e)&&this.injectTabIds.set(e,l(l({},this.injectTabIds.get(e)),{},{lastTimestamp:Number(new Date),active:!0}))})),c(this,"stopHeartBeatAndReport",(e=>{var t,n,r,i,o;this.crashLog&&lo(">>>>>>>>>>>>crash>>>>>>>>>>>>>>>>",null===(t=this.injectTabIds.get(e))||void 0===t?void 0:t.tabInfo),this.category=ti.PAGE_CRASH,this.msg=`${(null===(n=this.injectTabIds.get(e))||void 0===n||null===(n=n.tabInfo)||void 0===n?void 0:n.title)||""}\u53d1\u751fcrash\uff0c\u9875\u9762\u72b6\u6001\u4e3a${(null===(r=this.injectTabIds.get(e))||void 0===r||null===(r=r.tabInfo)||void 0===r?void 0:r.status)||""}`,this.pageUrl=(null===(i=this.injectTabIds.get(e))||void 0===i||null===(i=i.tabInfo)||void 0===i?void 0:i.url)||"",this.recordError({name:ti.PAGE_CRASH}),clearTimeout(null===(o=this.injectTabIds.get(e))||void 0===o?void 0:o.timer),this.injectTabIds.delete(e)})),this.injectTabIds=new Map,this.initListeners()}initListeners(){var e;const t=this,n={name:"crash-monitor-message",handle:(e,n)=>{var r,i,o,s,a,c,u;if(null!=e&&e.crashMonitorInject&&null!=n&&null!==(r=n.tab)&&void 0!==r&&r.id)return t.removeTabId(null==n||null===(i=n.tab)||void 0===i?void 0:i.id),t.injectTabIds.set(null===(o=n.tab)||void 0===o?void 0:o.id,null),t.crashLog&&lo("injectTabIds: ",t.injectTabIds),t.start(),!0;(null==e?void 0:e.type)===no&&(t.crashLog&&lo("PAGE_VISIBILITY_FALSE: ",null===(s=n.tab)||void 0===s?void 0:s.id),t.clearTimeId(null==n||null===(a=n.tab)||void 0===a?void 0:a.id));(null==e?void 0:e.type)===ro&&(t.crashLog&&lo("PAGE_VISIBILITY_TRUE: ",null===(c=n.tab)||void 0===c?void 0:c.id),t.updateActiveTime(null==n||null===(u=n.tab)||void 0===u?void 0:u.id),t.start())}};Ao(n),null===(e=chrome.tabs)||void 0===e||e.onActivated.addListener((e=>{t.crashLog&&lo("currentActiveTabId:  ",null==e?void 0:e.tabId),t.updateActiveTime(null==e?void 0:e.tabId),t.start()})),chrome.tabs.onRemoved.addListener((e=>{t.removeTabId(e)}))}};const Jd=function(){},Hd=function(){var e=o((function*(e,t){const{url:n,data:r,success:i=Jd,fail:o=Jd}=t,s={method:e,headers:{"Content-Type":"application/json"},mode:"cors",credentials:"include"};r&&(s.body=r);try{const e=yield fetch(n,s),t=yield e.json();if(!e.ok)throw Error(t);i(t)}catch(a){o(a)}}));return function(t,n){return e.apply(this,arguments)}}();let Kd=function(e){return e[e.None=0]="None",e[e.AsOld=1]="AsOld",e[e.AsNew=2]="AsNew",e}({});class $d{constructor(){c(this,"_map",void 0),c(this,"_head",void 0),c(this,"_tail",void 0),c(this,"_size",void 0),this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=Kd.None){const n=this._map.get(e);if(n)return t!==Kd.None&&this.touch(n,t),n.value}set(e,t,n=Kd.None){let r=this._map.get(e);if(r)r.value=t,n!==Kd.None&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case Kd.None:this.addItemLast(r);break;case Kd.AsOld:this.addItemFirst(r);break;case Kd.AsNew:default:this.addItemLast(r)}this._map.set(e,r),this._size++}}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._head;for(;n;)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.next}forEachLast(e,t){let n=this._tail;for(;n;)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.previous}findLast(e){let t=this._tail;for(;t;){if(e(t.value,t.key,this))return t;t=t.previous}}find(e){let t=this._head;for(;t;){if(e(t.value,t.key,this))return t;t=t.next}}values(){const e=[];let t=this._head;for(;t;)e.push(t.value),t=t.next;return e}keys(){const e=[];let t=this._head;for(;t;)e.push(t.key),t=t.next;return e}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0)}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const{next:t}=e,{previous:n}=e;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===Kd.AsOld||t===Kd.AsNew)if(t===Kd.AsOld){if(e===this._head)return;const{next:t}=e,{previous:n}=e;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e}else if(t===Kd.AsNew){if(e===this._tail)return;const{next:t}=e,{previous:n}=e;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}let Yd=null;const Xd=new class extends $d{constructor(e,t=1){super(),c(this,"_limit",void 0),c(this,"_ratio",void 0),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e){return super.get(e,Kd.AsNew)}peek(e){return super.get(e,Kd.None)}set(e,t){super.set(e,t,Kd.AsNew),this.checkTrim()}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}(100);globalThis.__perfCache=Xd;const Qd=new PerformanceObserver((function(e,t){e.getEntries().forEach((e=>{if("resource"===e.entryType){const t=(e=>{try{const t=new URL(e);return!!t.origin.includes(Rs)&&`${t.origin}${t.pathname}`}catch(t){return!1}})(e.name);if(t){lo("[Daniel] PerformanceObserver",`${t} duration: ${e.duration}`,e);const{startTime:n,domainLookupStart:r,domainLookupEnd:i,connectStart:o,connectEnd:s,requestStart:a,responseStart:c,responseEnd:u,transferSize:l,encodedBodySize:d,duration:f}=e;Yd?Yd.sendEvent({name:"api_timing",metrics:{startTime:n,domainLookupStart:r,domainLookupEnd:i,connectStart:o,connectEnd:s,requestStart:a,responseStart:c,responseEnd:u,transferSize:l,encodedBodySize:d,duration:f},categories:{url:t}}):fo("[lwx] BgSlardar not set!!"),Xd.set(`${Date.now()} - ${t}`,{"server-origin":performance.timeOrigin,"server-duration":f,"server-startTime":n,"server-transferSize":l,"server-requestStart":a,"server-responseStart":c,"server-responseEnd":u,"server-encodedBodySize":d})}}}))}));const Zd=new class{constructor(e){var t,n,r,i,o,s,a,u,d,f;c(this,"jsMonitor",void 0),c(this,"promiseMonitor",void 0),c(this,"fetchMonitor",void 0),c(this,"crashMonitor",void 0),c(this,"bid",void 0),c(this,"crashLog",void 0),c(this,"region",void 0),c(this,"_options",void 0),c(this,"client",void 0),c(this,"prepared",!1),c(this,"start",((e={})=>{if(self){const t="function"==typeof fetch?{get(e){Hd("GET",e)},post(e){Hd("POST",e)}}:{get:Jd,post:Jd},n=wo();this.client.init(l({env:"public",release:n,version:n,bid:this.bid,transport:{get:t.get,post:t.post}},e)),this.client.start(),this.runBgMonitors(),this.addMessageListeners(),(e=>{Yd=e,Qd.observe({entryTypes:["resource"]})})(this),this.prepared=!0}})),c(this,"config",(e=>{this.client.config(e)})),c(this,"runBgMonitors",(()=>{var e;(this.jsMonitor&&new Wd(this.region),this.promiseMonitor&&new qd(this.region),this.fetchMonitor)&&new zd({region:this.region,rule:null===(e=this._options.plugins)||void 0===e?void 0:e.fetchInterceptRule});this.crashMonitor&&new Vd(this.region,this.crashLog)})),c(this,"addMessageListeners",(()=>{const e=this;Ao({name:"slardar-message",handle:t=>{const{type:n,data:r}=t||{};switch(n){case io:e.sendEvent(r);break;case oo:case so:e.sendLog(r)}}})})),c(this,"sendEvent",(e=>{var t,n;this.prepared&&(null===(t=(n=this.client).sendEvent)||void 0===t||t.call(n,e),Dd({type:"slardar",payload:e,action:"event"}))})),c(this,"sendLog",(e=>{var t,n;this.prepared&&(null===(t=(n=this.client).sendLog)||void 0===t||t.call(n,e),Dd({type:"slardar",payload:e,action:"log"}))})),this.jsMonitor=null===(t=null==e||null===(n=e.plugins)||void 0===n?void 0:n.jsMonitor)||void 0===t||t,this.promiseMonitor=null===(r=null==e||null===(i=e.plugins)||void 0===i?void 0:i.promiseMonitor)||void 0===r||r,this.fetchMonitor=null===(o=null==e||null===(s=e.plugins)||void 0===s?void 0:s.fetchMonitor)||void 0===o||o,this.crashMonitor=null===(a=null==e||null===(u=e.plugins)||void 0===u?void 0:u.crashMonitor)||void 0===a||a,this.bid=e.bid,this.crashLog=null!==(d=null==e||null===(f=e.log)||void 0===f?void 0:f.crashLog)&&void 0!==d&&d,this.region=ao.CN,this._options=e,this.client=uo(this.region)}configExtraInfo(e){ni.recordExtraInfo(e)}}({bid:"flow_web_ext",plugins:{promiseMonitor:!1,crashMonitor:!1}});var ef=n(86296);const tf=ef,nf=new ef;class rf extends Error{constructor(e,t){super(`ServerError, code: ${e}, msg:${t}`),this.code=e}}Error;const of=function(){var e=o((function*(e,t){var n,r;const{url:i,method:o,data:s,params:a,headers:c}=e,u=yield fetch(jd(i,l(l({},Ld()),a)),{method:o,body:JSON.stringify(s),headers:l(l({},Cd()),{},{"Content-Type":"application/json"},c)}),d=null===(n=u.headers)||void 0===n||null===(r=n.get)||void 0===r?void 0:r.call(n,"x-tt-logid");if(!u.ok)throw Dd({type:"http-request",payload:{config:e,response:{statusText:u.statusText},logId:d}}),new Error(u.statusText);const f=yield u.json();Dd({type:"http-request",payload:{config:e,response:f,logId:d}});const{code:p,msg:h}=f;var m;if(void 0!==p&&0!==p)throw Zd.sendEvent(l({name:"response_server_code_invalid"},j({url:null==e?void 0:e.url,msg:h,code:`${p}`,statusCode:200,isSse:!1,"x-tt-env":null==e||null===(m=e.headers)||void 0===m?void 0:m["x-tt-env"],logId:d}))),new rf(p,h);return[Pd.NOACCESS,Pd.NOT_LOGIN].includes(Number(p))&&nf.emit("auth-info-request-updated"),l(l({},f),{},{logId:d})}));return function(t,n){return e.apply(this,arguments)}}(),sf=function(){var e=o((function*(...e){const{data:t}=yield of(...e);return t}));return function(){return e.apply(this,arguments)}}();function af(){return cf.apply(this,arguments)}function cf(){return(cf=o((function*(){const e={aid:null!=Ls?Ls:"",account_sdk_source:"web",sdk_version:"2.2.5"},{name:t,user_id_str:n,avatar_url:r,sec_user_id:i}=yield sf({url:`https://${Rs}/passport/account/info/v2/`,params:e,method:"GET",headers:Cd()});return{name:t,nickname:t,userId:n,secUserId:i,avatarUrl:r,isAuthenticated:Boolean(n)}}))).apply(this,arguments)}!function(e,t){let n,r=-1,i=!0}(af,6e4);function uf(){return(uf=o((function*(){const e={aid:null!=Ls?Ls:"",account_sdk_source:"web",sdk_version:"2.2.5"};return yield sf({url:`https://${Rs}/passport/web/logout/`,params:e,method:"GET",headers:Cd()}),{isAuthenticated:!1}}))).apply(this,arguments)}function lf(e,t){return df.apply(this,arguments)}function df(){return(df=o((function*(e,t){const n={aid:null!=Ls?Ls:"",account_sdk_source:"web",sdk_version:"2.2.5",token:e,state:t};return yield sf({url:`https://${Rs}/passport/transfer/token_auth/`,params:n,method:"POST",headers:Cd()}),{isAuthenticated:!0}}))).apply(this,arguments)}const ff=function(e,t){return wr(e,t,(function(t,n){return cr(e,n)}))};var pf=k?k.isConcatSpreadable:void 0;const hf=function(e){return L(e)||Ae(e)||!!(pf&&e&&e[pf])};const mf=function e(t,n,r,i,o){var s=-1,a=t.length;for(r||(r=hf),o||(o=[]);++s<a;){var c=t[s];n>0&&r(c)?n>1?e(c,n-1,r,i,o):hn(o,c):i||(o[o.length]=c)}return o};const _f=function(e){return(null==e?0:e.length)?mf(e,1):[]};const gf=function(e){return jo(Co(e,void 0,_f),e+"")};const vf=gf((function(e,t){return null==e?{}:ff(e,t)}));let yf,bf,wf;const kf=new tf;function Ef(e){var t;const n=null===(t=yf)||void 0===t||null===(t=t.tabs)||void 0===t?void 0:t[0];return!(!e||!n)&&(e.windowId===n.windowId&&e.id===n.id)}function Sf(){return(Sf=o((function*(e){const{url:t,availLeft:n=0,availTop:r=0,screenHeight:i=0,screenWidth:o=0,width:s=0,height:a=0,type:c="popup",state:u="normal"}=e,l={url:t,focused:!0,type:c,state:u,width:s,height:a,left:Math.round((o-s)/2)+n,top:Math.round((i-a)/2)+r};return yf=yield chrome.windows.create(l),yf}))).apply(this,arguments)}function Tf(){return Tf=o((function*(){try{chrome.windows.onRemoved.addListener((e=>{e===bf&&kf.emit("login-window-closed",e)})),chrome.windows.onFocusChanged.addListener((e=>{bf=wf,wf=e}));const{id:e}=yield chrome.windows.getCurrent();wf=e}catch(e){oc.persist.info({eventName:"init_manager",meta:l({},j({message:null==e?void 0:e.message}))})}})),Tf.apply(this,arguments)}function If(){return sf({method:"GET",url:`${Ps}/feed`,params:Ld(),headers:Cd()})}function xf(){return(xf=o((function*(){const{main_thread:e}=yield If();!function(e,t=!1){Wa("chatInfo",e,t)}({mainConversation:null==e?void 0:e.conversation})}))).apply(this,arguments)}function Of(){return Of=o((function*(){yield function(){return xf.apply(this,arguments)}()})),Of.apply(this,arguments)}const Nf={};function Af(e=Nf){const{tab:t}=e;return{authInfo:Ha(),isLoginWindow:Ef(t)}}const Rf=function(){var e=o((function*(e,t,n){(yield chrome.tabs.query(e)).forEach((e=>{e.id&&Eo({tabId:e.id,name:t,body:l(l({},Af({tab:e})),n)}).catch((()=>{}))}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Lf=()=>Rf({},"auth-info-updated");function Cf(){return Pf.apply(this,arguments)}function Pf(){return(Pf=o((function*(){return sf({method:"POST",url:`${Ms}/user/launch`,params:Ld(),headers:Cd()})}))).apply(this,arguments)}function Mf(){return(Mf=o((function*(e){return sf({method:"POST",url:`${Ps}/user/web_hit_status/update`,data:{status:e},headers:Cd()})}))).apply(this,arguments)}function Df(){return(Df=o((function*(){try{const e=yield af();if(!e.isAuthenticated)return e;const{profile_brief:{user_name:t,nickname:n,image:r}={}}=yield function(e=(e=>null===(e=Ha())||void 0===e?void 0:e.userId)()){return sf({method:"POST",url:`${Ms}/profile/self`,params:Ld(),headers:Cd(),data:{visit_id:e}})}(e.userId),i=l(l({},e),{},{nickname:n,username:t,avatarUri:null==r?void 0:r.uri,isAuthenticated:Boolean(null==e?void 0:e.userId)});return i.avatarUrl||(i.avatarUrl=null==r?void 0:r.origin_url),i}catch(e){if(e instanceof rf&&(null==e?void 0:e.code)>0)return{isAuthenticated:!1};throw e}}))).apply(this,arguments)}function jf({authInfo:e,launchInfo:t,broadcast:n=!0}){if(lo("[zoei] handleAuthInfo",{authInfo:e,launchInfo:t,broadcast:n}),t){var r,i;const{assistant_bot_id:n="7241547611541340167",language_list:o=[],config:{ttwid:s,web_id:a}={},country:c,feature_config:u={}}=t,l=s&&s!==(null===(r=Xa())||void 0===r?void 0:r.ttWid);Qa({ttWid:s,webId:a,country:c},!0),Ya({assistantBotId:n,languageList:o,featureConfig:vf(u,["send_vlm_image_message"]),country:c}),function(e,t=!1){Wa("launchConfig",e,t)}(null!==(i=null==t?void 0:t.config)&&void 0!==i?i:{}),l&&!e.isAuthenticated&&nf.emit("ttwid-changed-un-authorized")}const{isChanged:o,changeEvents:s}=function(e){const{isAuthenticated:t,userId:n,username:r,nickname:i,avatarUri:o,country:s}=Ha(),a=[];return t!==e.isAuthenticated?a.push(e.isAuthenticated?"auth-login":"auth-logout"):n&&e.userId&&n!==e.userId&&(a.push("auth-login"),a.push("auth-switch-account")),{isChanged:t!==e.isAuthenticated||n!==e.userId||r!==e.username||i!==e.nickname||o!==e.avatarUri||s!==e.country,changeEvents:a}}(e);return o&&(lo("[zoei] authInfo changed",e),Ka(e),s.forEach((t=>nf.emit(t,e))),n&&Lf()),function(){Of.apply(this,arguments)}(),e}function Bf(){return Ff.apply(this,arguments)}function Ff(){return Ff=o((function*(e={}){lo("[zoei] updateAuthInfo",e);const{broadcast:t=!0}=e;try{const e=yield function(){return Df.apply(this,arguments)}();return jf({authInfo:e,launchInfo:yield Cf(),broadcast:t})}catch(n){lo("[zoei] updateAuthInfo error",n)}})),Ff.apply(this,arguments)}function Uf(){return Gf.apply(this,arguments)}function Gf(){return(Gf=o((function*(){const{value:e=""}=(yield chrome.cookies.get({name:"s_v_web_id",url:`https://${Rs}/?from=ext`}))||{};Qa({svWebId:e},!0)}))).apply(this,arguments)}function qf(){return(qf=o((function*(){var e;e=()=>{lo("[zoei] login window closed, udpateAuthInfo"),Bf({reason:"auth service: login window closed"})},kf.on("login-window-closed",e),nf.on("auth-login",Uf),nf.on("auth-switch-account",Uf),yield Bf({broadcast:!1,reason:"auth service: init"})}))).apply(this,arguments)}function Wf(){return Wf=o((function*(){const e=yield function(){return uf.apply(this,arguments)}();Ka(e),Lf()})),Wf.apply(this,arguments)}class zf{constructor(){var e=this;c(this,"stop",!1),c(this,"latestLoginState",{authToken:"",appLoginKey:""}),c(this,"getLocalLoginStatus",(()=>Ha().isAuthenticated)),c(this,"updateLoginState",o((function*(){const{auth_token:t,app_login_key:n}=yield(()=>{let e;const t=new Promise((t=>{e=t}));return chrome.runtime.sendNativeMessage("",{request_type:"REQUEST_TOKEN"},(t=>{e(t)})),t})();e.latestLoginState.appLoginKey=n,e.latestLoginState.authToken=t}))),c(this,"getAppLoginState",o((function*(){return yield e.updateLoginState(),Boolean(e.latestLoginState.authToken)}))),c(this,"checkIfShouldLogin",o((function*(){let t=!1;try{e.getLocalLoginStatus()||(t=yield e.getAppLoginState())}catch(n){oc.persist.error({message:"getAppLoginState error",error:n})}return t}))),c(this,"tryLoginWithLatestToken",o((function*(){let t=0,n=!1;for(;t<zf.LOGIN_RETRY_LIMIT;){const{authToken:i,appLoginKey:o}=e.latestLoginState;try{const{isAuthenticated:e}=yield lf(i,o);e&&(n=!0,t=zf.LOGIN_RETRY_LIMIT)}catch(r){oc.persist.error({message:"loginByAuthToken error",error:r})}t+=1}return n}))),c(this,"startLoopLoginStatus",o((function*(){for(e.stop=!1;!e.stop;){const t=Date.now();if(yield e.checkIfShouldLogin()){(yield e.tryLoginWithLatestToken())&&Bf()}const n=Date.now()-t;n<1e3&&(yield new Promise((e=>{setTimeout(e,1e3-n)})))}}))),c(this,"stopLoopLoginStatus",(()=>{this.stop=!0}))}}c(zf,"LOGIN_RETRY_LIMIT",3);const Vf=new zf;const Jf=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};const Hf=function(e,t){return e&&os(t,In(t),e)};const Kf=function(e,t){return e&&os(t,xr(t),e)};const $f=function(e,t){return os(e,bn(e),t)};const Yf=function(e,t){return os(e,Er(e),t)};var Xf=Object.prototype.hasOwnProperty;const Qf=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Xf.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const Zf=function(e,t){var n=t?Vo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var ep=/\w*$/;const tp=function(e){var t=new e.constructor(e.source,ep.exec(e));return t.lastIndex=e.lastIndex,t};var np=k?k.prototype:void 0,rp=np?np.valueOf:void 0;const ip=function(e){return rp?Object(rp.call(e)):{}};const op=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Vo(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Zf(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Jo(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return tp(e);case"[object Symbol]":return ip(e)}};const sp=function(e){return C(e)&&"[object Map]"==Te(e)};var ap=Ve&&Ve.isMap;const cp=ap?Ue(ap):sp;const up=function(e){return C(e)&&"[object Set]"==Te(e)};var lp=Ve&&Ve.isSet;const dp=lp?Ue(lp):up;var fp="[object Arguments]",pp="[object Function]",hp="[object Object]",mp={};mp[fp]=mp["[object Array]"]=mp["[object ArrayBuffer]"]=mp["[object DataView]"]=mp["[object Boolean]"]=mp["[object Date]"]=mp["[object Float32Array]"]=mp["[object Float64Array]"]=mp["[object Int8Array]"]=mp["[object Int16Array]"]=mp["[object Int32Array]"]=mp["[object Map]"]=mp["[object Number]"]=mp[hp]=mp["[object RegExp]"]=mp["[object Set]"]=mp["[object String]"]=mp["[object Symbol]"]=mp["[object Uint8Array]"]=mp["[object Uint8ClampedArray]"]=mp["[object Uint16Array]"]=mp["[object Uint32Array]"]=!0,mp["[object Error]"]=mp[pp]=mp["[object WeakMap]"]=!1;const _p=function e(t,n,r,i,o,s){var a,c=1&n,u=2&n,l=4&n;if(r&&(a=o?r(t,i,o,s):r(t)),void 0!==a)return a;if(!J(t))return t;var d=L(t);if(d){if(a=Qf(t),!c)return Ho(t,a)}else{var f=Te(t),p=f==pp||"[object GeneratorFunction]"==f;if(je(t))return zo(t,c);if(f==hp||f==fp||p&&!o){if(a=u||p?{}:Yo(t),!c)return u?Yf(t,Kf(a,t)):$f(t,Hf(a,t))}else{if(!mp[f])return o?t:{};a=op(t,f,c)}}s||(s=new Zt);var h=s.get(t);if(h)return h;s.set(t,a),dp(t)?t.forEach((function(i){a.add(e(i,n,r,i,t,s))})):cp(t)&&t.forEach((function(i,o){a.set(o,e(i,n,r,o,t,s))}));var m=d?void 0:(l?u?Or:xn:u?xr:In)(t);return Jf(m||t,(function(i,o){m&&(i=t[o=i]),yr(a,o,e(i,n,r,o,t,s))})),a};const gp=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};const vp=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o};const yp=function(e,t){return t.length<2?e:ir(e,vp(t,0,-1))};const bp=function(e,t){return t=nr(t,e),null==(e=yp(e,t))||delete e[rr(gp(t))]};const wp=function(e){return rs(e)?void 0:e};var kp=gf((function(e,t){var n={};if(null==e)return n;var r=!1;t=Xn(t,(function(t){return t=nr(t,e),r||(r=t.length>1),t})),os(e,Or(e),n),r&&(n=_p(n,7,wp));for(var i=t.length;i--;)bp(n,t[i]);return n}));const Ep=kp,Sp=()=>{za("tabConversationMap",{})},Tp={npaliedit:5,gameplugin:5,npjlgplayer3:5,npqplug:5,npqbrowserplugin:5,"np-mswmp":3,npcombrg:3};Object.keys(Tp);const Ip=()=>{var e;return null===(e=navigator.userAgent)||void 0===e?void 0:e.includes("Samantha")},xp=()=>{var e;const t=or(navigator,"userAgentData.brands",[]);return null==t||null===(e=t.some)||void 0===e?void 0:e.call(t,(e=>["Chrome"].some((t=>{var n;return null==e||null===(n=e.brand)||void 0===n?void 0:n.includes(t)}))))};const Op=function(){var e=o((function*(){if(!(Ip()||xp()))return!1;const e=chrome.sidePanel&&void 0!==typeof chrome.runtime.getContexts&&void 0!==typeof chrome.sidePanel.open&&void 0!==typeof chrome.sidePanel.setOptions;try{yield chrome.sidePanel.getPanelBehavior()}catch(t){return!1}return e}));return function(){return e.apply(this,arguments)}}(),Np=function(){var e=o((function*(e){yield chrome.sidePanel.open({windowId:e}),za("sidePanelEnabled",!0)}));return function(t){return e.apply(this,arguments)}}(),Ap=function(){var e=o((function*(){yield chrome.sidePanel.setOptions({enabled:!1}),chrome.sidePanel.setOptions({enabled:!0}),za("sidePanelEnabled",!1)}));return function(){return e.apply(this,arguments)}}(),Rp=e=>{var t,n;"function"==typeof chrome.runtime.getContexts&&(null===(t=(n=chrome.runtime).getContexts)||void 0===t||t.call(n,{contextTypes:["SIDE_PANEL"]},(t=>{e(Boolean((null==t?void 0:t.length)>0))})))},Lp=e=>new Promise((t=>{Rp((n=>{n?Ap():Np(e),t(!n)}))})),Cp=()=>{var e,t,n,r;const i=e=>{Eo({tabId:e,name:"tab-activated",body:{tabId:e}})};chrome.tabs.onActivated.addListener((e=>{chrome.tabs.get(e.tabId,(t=>{Rp((t=>{var n,r;t&&(n=e.tabId,r=e.windowId,ho({name:"sidepanel-tab-active",body:{tabId:n,windowId:r}}))})),(e=>{const t=e.startsWith("chrome://")||e.startsWith("chrome-extension://")||e.startsWith("edge://")||e.startsWith("about:"),n=["https://chrome.google.com/webstore","https://microsoftedge.microsoft.com/addons","https://addons.mozilla.org/en-US/firefox","https://chromewebstore.google.com/"].some((t=>e.startsWith(t)));return t||n})(t.url)||(e=>{try{const t=new URL(e);return[Ds,js].some((e=>t.host.endsWith(e)))&&!(t.pathname.startsWith(Ta)||t.pathname.startsWith("/ext/"))||t.pathname.includes("/login")&&!t.search.includes("loginSuccessBackUrl")}catch(t){return!1}})(t.url)||i(e.tabId)}))})),chrome.tabs.onUpdated.addListener((e=>{i(e)})),chrome.tabs.onRemoved.addListener((e=>{(e=>{const{isAuthenticated:t,userId:n}=Va("authInfo");if(!t||!n)return;if(!e)return;const r=Va("tabConversationMap"),i=Ep(r,[e]);za("tabConversationMap",i)})(e)})),h()?chrome.action.setPopup({popup:""}):(Op().then((e=>{e||chrome.action.setPopup({popup:"popup.html"})})),null===(e=chrome.sidePanel)||void 0===e||null===(t=e.setPanelBehavior)||void 0===t||t.call(e,{openPanelOnActionClick:!1}),null===(n=chrome.action)||void 0===n||null===(n=n.onClicked)||void 0===n||null===(r=n.addListener)||void 0===r||r.call(n,(e=>{Lp(e.windowId).then((e=>{if(e){const e={name:"update-zustand-state",body:[{storeKey:"layout",key:"enterSidebarMode",data:"action_click"}]};Io(e).then((t=>{t.success||setTimeout((()=>mo(e)),4e3)}))}}))})))};const Pp=function(e){return _p(e,5)};const Mp=function(){return w.Date.now()};var Dp=/\s/;const jp=function(e){for(var t=e.length;t--&&Dp.test(e.charAt(t)););return t};var Bp=/^\s+/;const Fp=function(e){return e?e.slice(0,jp(e)+1).replace(Bp,""):e};var Up=/^[-+]0x[0-9a-f]+$/i,Gp=/^0b[01]+$/i,qp=/^0o[0-7]+$/i,Wp=parseInt;const zp=function(e){if("number"==typeof e)return e;if(Gn(e))return NaN;if(J(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=J(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Fp(e);var n=Gp.test(e);return n||qp.test(e)?Wp(e.slice(2),n?2:8):Up.test(e)?NaN:+e};var Vp=Math.max,Jp=Math.min;const Hp=function(e,t,n){var r,i,o,s,a,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,o=i;return r=i=void 0,u=t,s=e.apply(o,n)}function h(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-u>=o}function m(){var e=Mp();if(h(e))return _(e);a=setTimeout(m,function(e){var n=t-(e-c);return d?Jp(n,o-(e-u)):n}(e))}function _(e){return a=void 0,f&&r?p(e):(r=i=void 0,s)}function g(){var e=Mp(),n=h(e);if(r=arguments,i=this,c=e,n){if(void 0===a)return function(e){return u=e,a=setTimeout(m,t),l?p(e):s}(c);if(d)return clearTimeout(a),a=setTimeout(m,t),p(c)}return void 0===a&&(a=setTimeout(m,t)),s}return t=zp(t)||0,J(n)&&(l=!!n.leading,o=(d="maxWait"in n)?Vp(zp(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),g.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=c=i=a=void 0},g.flush=function(){return void 0===a?s:_(Mp())},g};const Kp=function(e,t){return Mn(e,t)};const $p=new class{constructor(){c(this,"_hasSyncedData",void 0),c(this,"handleAuthenticateChange",(({newValue:e,oldValue:t})=>{!1===(null==t?void 0:t.isAuthenticated)&&!0===(null==e?void 0:e.isAuthenticated)&&this.syncFromServer()})),c(this,"deferSyncToServer",Hp((()=>{this.syncToServer()}),5e3))}hasSyncedData(){var e=this;return o((function*(){if(void 0===e._hasSyncedData)try{const t=yield e._fetch();e._hasSyncedData=!!t}catch(t){e._hasSyncedData=!1}return e._hasSyncedData}))()}updateSettings(e){for(const[n,r]of Object.entries(e)){if(!Fa.includes(n))continue;const e=Pp(Va(n)),i=!Kp(e,Ba[n]);if(!Kp(e,r)&&!i){const i=Pp(r);null===(t=i)||"object"!=typeof t||Array.isArray(t)||ps(i,e),za(n,i)}}var t}syncFromServer(){var e=this;return o((function*(){const t=yield e.fetchSetting();e.deferSyncToServer(),t&&e.updateSettings(t)}))()}syncToServer(){var e=this;return o((function*(){const t=e.getSettings();yield e.saveSetting(t)}))()}getSettings(){const e={};for(const t of Fa)e[t]=Va(t);return e}startSync(){ks.watch({authInfo:this.handleAuthenticateChange});const e={};for(const t of Fa)e[t]=this.deferSyncToServer;ks.watch(e)}unbind(){ks.unwatch({authInfo:this.handleAuthenticateChange});const e={};for(const t of Fa)e[t]=this.deferSyncToServer;ks.unwatch(e)}_fetch(){return o((function*(){return(yield sf({url:`https://${Rs}/samantha/plugin/user_settings/get`,params:{frontend_source:1},method:"GET",headers:Cd()})).settings}))()}fetchSetting(){var e=this;return o((function*(){try{const t=yield e._fetch();if(!t)return;return JSON.parse(t)}catch(t){return}}))()}saveSetting(e){return o((function*(){try{return yield sf({url:`https://${Rs}/samantha/plugin/user_settings/save`,data:{settings:JSON.stringify(e),frontend_source:1},method:"POST",headers:Cd()}),!0}catch(t){return!1}}))()}destroy(){this.unbind()}};class Yp extends tf{constructor(e,t){super(),c(this,"socket",null),c(this,"reconnectTimes",0),c(this,"reconnectTimer",null),c(this,"_initOptions",null),c(this,"_events",null),c(this,"reconnect",(()=>{var e;if(this.reconnectTimes>=((null===(e=this._initOptions)||void 0===e?void 0:e.maxRetryTime)||10))return fo("websocket retry times limited!"),void this.emit("reconnect-limited");this.destroy(),this.connect()})),c(this,"connect",(()=>{const e=this._initOptions;e?(this.socket=new WebSocket(e.url),this.socket.binaryType=e.binaryType||"blob",this.reconnectTimer=setTimeout((()=>{var e;0===(null===(e=this.socket)||void 0===e?void 0:e.readyState)&&(this.reconnect(),this.reconnectTimes++)}),e.reconnectTime||5e3),this.socket.addEventListener("open",this._handleOpen),this.socket.addEventListener("message",this._handleMessage),this.socket.addEventListener("error",this._handleError),this.socket.addEventListener("close",this._handleClose)):fo("websocket options not found")})),c(this,"_handleOpen",(()=>{var e,t;1===(null===(e=this.socket)||void 0===e?void 0:e.readyState)&&this.reconnectTimer&&clearTimeout(this.reconnectTimer),null===(t=this._events)||void 0===t||t.onopen()})),c(this,"_handleMessage",(e=>{var t;null===(t=this._events)||void 0===t||t.onmessage({data:e.data})})),c(this,"_handleClose",(e=>{var t;null===(t=this._events)||void 0===t||t.onclose({code:e.code,reason:e.reason}),this.emit("close")})),c(this,"_handleError",(e=>{var t;null===(t=this._events)||void 0===t||t.onerror(e),this.emit("error")})),c(this,"destroy",(()=>{const{socket:e}=this;e&&(e.removeEventListener("open",this._handleOpen),e.removeEventListener("message",this._handleMessage),e.removeEventListener("error",this._handleError),e.removeEventListener("close",this._handleClose),e.close()),this.socket=null,this.reconnectTimer&&clearTimeout(this.reconnectTimer)})),this._events=t,this._initOptions=e,this.connect()}getSocket(){return this.socket}sendMessage(e){var t,n;1===(null===(t=this.socket)||void 0===t?void 0:t.readyState)?this.socket.send(e):fo(`websocket state[${null===(n=this.socket)||void 0===n?void 0:n.readyState}] not open for send message`)}}const Xp=new class{constructor(){c(this,"clients",{})}get(e){const t=this.clients[e];return t||fo("websocket client not found!"),t}create(e,t){const n=new Yp(t.options,t.events);return n.once("close",(()=>delete this.clients[e])),n.once("error",(()=>delete this.clients[e])),this.clients[e]=n,n}close(e){var t;null===(t=this.clients[e])||void 0===t||t.destroy(),delete this.clients[e]}reconnect(e){var t;null===(t=this.clients[e])||void 0===t||t.reconnect()}},Qp=(e,t)=>{const{id:n,action:r,data:i}=e.body||{};if(!n||!r)return;const o={onopen:()=>t.send({id:n,action:"open"}),onmessage:e=>t.send({id:n,action:"message",data:e}),onerror:e=>t.send({id:n,action:"error",error:e}),onclose:e=>t.send({id:n,action:"close",data:e})};switch(r){case"init":Xp.create(n,{options:i,events:o});break;case"message":var s,a;if(L(i))null===(s=Xp.get(n))||void 0===s||s.sendMessage(new Uint8Array(i));else null===(a=Xp.get(n))||void 0===a||a.sendMessage(i);break;case"close":Xp.close(n);break;case"reconnect":Xp.reconnect(n)}};var Zp=1,eh=2;const th=e=>{try{return JSON.stringify(e)}catch(t){return""}};var nh=n(86152);function rh(){return(rh=o((function*(e){return new Promise((t=>{lo(e),t("unknown reason")}))}))).apply(this,arguments)}const ih=()=>{const e=Va("uuid");if(e)return e;const t=(()=>{const e=Math.floor(1e8+9e8*Math.random()),t=Math.floor(1e8+9e8*Math.random());return String(e)+String(t)})();return za("uuid",t),t};const oh={0:"CONNECTING",1:"OPEN",2:"CLOSING",3:"CLOSED"};function sh(e,t){var n;const r=null==t?void 0:t(e);return{fpID:e.ws_product_id||"",aID:e.ws_app_id||"",accessKey:e.ws_access_key||"",url:e.ws_domain||"",service:Number(e.message_service_id)||0,ttwID:e.ttwid,customParams:l(l(l({version_code:20650,pkg_type:Bs,language:_s(Va("uiLanguage"))},Cd()),r||{}),{},{device_platform:"web",from_ext:1,device_id:null!==(n=Rd())&&void 0!==n?n:"",tea_uuid:ih(),samantha_web:1,real_aid:Ls||""})}}function ah(e){var t;const n=((e,t)=>{try{return e?JSON.parse(e):t}catch(n){return t}})((new TextDecoder).decode(e.message.payload)),r=null===(t=e.message.headers)||void 0===t||null===(t=t.find((e=>"x_frontier_traceid"===e.key)))||void 0===t?void 0:t.value;if(!n||"object"!=typeof n||!("event_type"in n))return;const i=n;return null!=i&&i.event_type?{event:i,traceId:r}:void 0}const ch=new class{constructor(){var e=this;c(this,"fws",void 0),c(this,"setSocketStatus",void 0),c(this,"refreshSocketConfig",void 0),c(this,"lastDisconnectTime",0),c(this,"closeCount",0),c(this,"hasConnected",!1),c(this,"options",null),c(this,"getSocketParams",void 0),c(this,"send",function(){var t=o((function*(t){if(!e.fws)throw new Error("fws send error: expect fws instance");return e.fws.send(t)}));return function(e){return t.apply(this,arguments)}}())}checkConnection(){var e,t,n;(null===(e=this.fws)||void 0===e?void 0:e.readyState)!==(null===(t=this.fws)||void 0===t?void 0:t.OPEN)?this.reconnect("reconnecting on readyState != OPEN"):null===(n=this.fws)||void 0===n||n.pingOnce().catch((()=>{this.closeCount=0,this.lastDisconnectTime=0,this.reconnect("reconnecting on ping failure")}))}reconnect(e){var t=this;return o((function*(){var n,r,i;Zd.sendEvent(l({name:"ws_reconnect"},j({readyState:null===(n=t.fws)||void 0===n?void 0:n.readyState,reason:e})));const o=yield null===(r=t.refreshSocketConfig)||void 0===r?void 0:r.call(t);var s;if(o&&(t.options=sh(o,t.getSocketParams),t.options))return void(null===(s=t.fws)||void 0===s||s.reconnect(t.options));null===(i=t.fws)||void 0===i||i.reconnect()}))()}init(e){var t,n=this;const{config:r,onSocketStatusChange:i,onMessage:s,refreshSocketConfig:a,getSocketParams:c}=e;this.setSocketStatus=i,this.refreshSocketConfig=a,this.getSocketParams=c,this.options=sh(r,c),lo("[websocket] options: ",this.options),this.fws=new nh.FWS(l(l({},this.options),{},{maxRetries:10,maxMessageQueueLength:0})),null===(t=this.setSocketStatus)||void 0===t||t.call(this,{loading:!0,connected:!1}),this.fws.onopen=()=>{var e;this.hasConnected=!0,0!==this.lastDisconnectTime&&(Zd.sendEvent(l({name:"ws_online"},j({offline_duration:Date.now()-this.lastDisconnectTime,offline_close_count:this.closeCount}))),this.lastDisconnectTime=0,this.closeCount=0),null===(e=this.setSocketStatus)||void 0===e||e.call(this,{loading:!1,connected:!0})},this.fws.onmessage=e=>{const t=ah(e);t&&s(t)},this.fws.onclose=function(){var e=o((function*(e){var t,r,i,o,s,a,c,u,d;n.closeCount+=1;let f="";var p;(0===n.lastDisconnectTime&&(n.lastDisconnectTime=Date.now()),n.closeCount%3==0)&&(f=yield function(e){return rh.apply(this,arguments)}((null===(p=n.fws)||void 0===p?void 0:p.url)||""));Zd.sendEvent(l({name:1e3===(null==e?void 0:e.code)?"ws_normal_closed":"ws_offline"},j({error:{message:`code=${null==e?void 0:e.code}, ${null==e?void 0:e.reason}`},config:{ws_domain:null===(t=n.options)||void 0===t?void 0:t.url,ws_ttwid:null===(r=n.options)||void 0===r?void 0:r.ttwID,ws_product_id:null===(i=n.options)||void 0===i?void 0:i.fpID,device_id:null===(o=n.options)||void 0===o?void 0:o.deviceID,ws_access_key:null===(s=n.options)||void 0===s?void 0:s.accessKey,ws_app_id:null===(a=n.options)||void 0===a?void 0:a.aID},has_connected:n.hasConnected,offline_count:n.closeCount,retry_count:null===(c=n.fws)||void 0===c?void 0:c.retryCount,will_reconnect:null==e?void 0:e.willReconnect,code:null==e?void 0:e.code,ws_detection:f,readyState:oh[null===(u=n.fws)||void 0===u?void 0:u.readyState]}))),null===(d=n.setSocketStatus)||void 0===d||d.call(n,{loading:e.willReconnect,connected:!1})}));return function(t){return e.apply(this,arguments)}}(),this.fws.onerror=e=>{if(null==e||!e.message)return;const t=new Error(`code=${null==e?void 0:e.code}, ${null==e?void 0:e.message}`);Zd.sendEvent(l({name:"ws_error"},j({error:t,message:null==e?void 0:e.message,code:null==e?void 0:e.code})))}}close(){var e;null===(e=this.fws)||void 0===e||e.close()}addEventListener(...e){var t;null===(t=this.fws)||void 0===t||t.addEventListener(...e)}removeEventListener(...e){var t;null===(t=this.fws)||void 0===t||t.removeEventListener(...e)}get readyState(){var e;return null===(e=this.fws)||void 0===e?void 0:e.readyState}drop(){this.close(),["open","close","message","error"].forEach((e=>{var t;return null===(t=this.fws)||void 0===t?void 0:t.off(e)})),this.fws&&(this.fws.onmessage=null,this.fws.onerror=null,this.fws.onclose=null,this.fws.onopen=null)}};globalThis.__socketClient=ch;const uh=new Set,lh=new WeakMap,dh=new Map;globalThis.__ciciInternalPortMap=lh;let fh=0;function ph(e,t){var n;const r=`${e.name}(${fh++})`;lo(`[Daniel] on port connect \u2705: ${r}`,e);const i={internalId:r,senderId:null===(n=e.sender)||void 0===n||null===(n=n.tab)||void 0===n?void 0:n.id,disconnected:!1,ext:{}};lh.set(e,i),dh.set(r,e),uh.add(e);const o=t=>{var n,r;i.disconnected=!0,t.name,null===(n=t.sender)||void 0===n||n.url,t.onDisconnect.removeListener(o),uh.delete(t);const a=null===(r=lh.get(e))||void 0===r?void 0:r.internalId;a&&dh.delete(a),s.forEach((e=>e()))},s=[];return e.onDisconnect.addListener(o),e.onMessage.addListener((n=>{if(t){const r=((t,n)=>t(l({port:e},n),{send:t=>{try{var n;const r=null===(n=hh(e))||void 0===n?void 0:n.disconnected;if(lo("[Daniel] send cs via port",e,r),r)return;e.postMessage(t)}catch(r){throw fo(r,e),r}}}))(t,n);"function"==typeof r&&s.push(r)}})),e}const hh=e=>lh.get(e),mh=function(){var e=o((function*(e=!1){const{fws:t}=ch;e&&t?ch.reconnect("\u8eab\u4efd\u53d8\u5316"):t?t.readyState!==t.CLOSED&&t.readyState!==t.CLOSING||(yield ch.reconnect("reconnecting on SendMsg")):ch.init({onSocketStatusChange:(...e)=>{lo('[Daniel] - ws "onSocketStatusChange"',e)},config:Ua.launchConfig,onMessage:e=>{bh(e)},refreshSocketConfig:function(){var e=o((function*(){return(yield Cf()).config}));return function(){return e.apply(this,arguments)}}()})}));return function(){return e.apply(this,arguments)}}(),_h=()=>{mh(!0)},gh=()=>{const{fws:e}=ch;null==e||e.close()};let vh="";const yh=e=>{const t=hh(e);vh=(null==t?void 0:t.internalId)||"",mh()},bh=e=>{var t;const n=(e=>dh.get(e))(vh);if(!n)return;if(lo("[socket-port] - ws recv \u{1f53d}",e),null!==(t=hh(n))&&void 0!==t&&t.disconnected)return;const r={};var i;e.event.event_type===Zp&&(r.last_reply_id=null===(i=e.event.message)||void 0===i?void 0:i.reply_id);((e,t)=>{const n=hh(e);n&&(n.ext=Object.assign({},n.ext,t))})(n,r),n.postMessage({event:"ws-message",body:e}),Dd({type:"websocket",payload:e,action:"recv"})},wh=(e,t)=>{const{type:n,payload:r}=e.body;if("connect-if-needed"===n)yh(e.port);else if("message"===n){yh(e.port);const{event_type:t,message:n,cmd:i}=r;lo("[Daniel] - ws send \u{1f53c}",r),t===Zp?ch.send(th({message:n,event_type:t})):t===eh&&ch.send(th({cmd:i,event_type:eh})),Dd({type:"websocket",payload:r,action:"send"})}else"check-connection"===n&&(lo("[Daniel] - check-connection",r),ch.checkConnection())};var kh=n(24323),Eh=n.n(kh);const Sh=(e,t)=>{const{url:n="",id:r=""}=e.body||{};n&&o((function*(){try{const e=yield(yield fetch(n)).blob(),i=yield e.arrayBuffer(),o=Eh()(new Uint8Array(i));!function(e,t){const n=524288;let r=0,i=n;const o=e.size%n,s=Math.floor(e.size/n)+(0===o?0:1);let a=0;const c=new FileReader;function u(){if(a>s-1)return;a===s-1&&0!==o&&(i=r+o),a++;const t=e.slice(r,i);r=i,i+=n,c.readAsArrayBuffer(t)}c.onload=function(){const e=Array.from(new Uint8Array(c.result));t({chunkIndex:a,chunks:s,blobData:e}),u()},u()}(e,(n=>t.send(l(l({},n),{},{id:r,type:e.type,originMd5:o}))))}catch(e){oc.persist.error({message:"local pdf error",error:e}),t.send({error:e.message})}}))()};let Th=function(e){return e.Unknown="unknown",e.File="file",e.Image="image",e.Text="text",e.Link="link",e}({});const Ih="%[a-f0-9]{2}";new RegExp("("+Ih+")|([^%]+?)","gi"),new RegExp("("+Ih+")+","gi");Symbol("encodeFragmentIdentifier");!function(){const e={service:null}}();let xh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Oh=[];for(let tt=0;tt<xh.length;tt++)Oh[xh[tt].charCodeAt(0)]=tt;Oh["-".charCodeAt(0)]=xh.indexOf("+"),Oh["_".charCodeAt(0)]=xh.indexOf("/");const Nh={dec(e){let t=3*e.length/4;"="==e[e.length-2]?t-=2:"="==e[e.length-1]&&(t-=1);let n,r=new Uint8Array(t),i=0,o=0,s=0;for(let a=0;a<e.length;a++){if(n=Oh[e.charCodeAt(a)],void 0===n)switch(e[a]){case"=":o=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string.")}switch(o){case 0:s=n,o=1;break;case 1:r[i++]=s<<2|(48&n)>>4,s=n,o=2;break;case 2:r[i++]=(15&s)<<4|(60&n)>>2,s=n,o=3;break;case 3:r[i++]=(3&s)<<6|n,o=0}}if(1==o)throw Error("invalid base64 string.");return r.subarray(0,i)},enc(e){let t,n="",r=0,i=0;for(let o=0;o<e.length;o++)switch(t=e[o],r){case 0:n+=xh[t>>2],i=(3&t)<<4,r=1;break;case 1:n+=xh[i|t>>4],i=(15&t)<<2,r=2;break;case 2:n+=xh[i|t>>6],n+=xh[63&t],r=0}return r&&(n+=xh[i],n+="=",1==r&&(n+="=")),n}};class Ah{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,t){const n=this.getType().runtime.bin,r=n.makeReadOptions(t);return n.readMessage(this,r.readerFactory(e),e.byteLength,r),this}fromJson(e,t){const n=this.getType(),r=n.runtime.json,i=r.makeReadOptions(t);return r.readMessage(n,e,i,this),this}fromJsonString(e,t){let n;try{n=JSON.parse(e)}catch(r){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${r instanceof Error?r.message:String(r)}`)}return this.fromJson(n,t)}toBinary(e){const t=this.getType().runtime.bin,n=t.makeWriteOptions(e),r=n.writerFactory();return t.writeMessage(this,r,n),r.finish()}toJson(e){const t=this.getType().runtime.json,n=t.makeWriteOptions(e);return t.writeMessage(this,n)}toJsonString(e){var t;const n=this.toJson(e);return JSON.stringify(n,null,null!==(t=null==e?void 0:e.prettySpaces)&&void 0!==t?t:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function Rh(e,t){if(!e)throw new Error(t)}const Lh=34028234663852886e22,Ch=-34028234663852886e22,Ph=4294967295,Mh=2147483647,Dh=-2147483648;function jh(e){if("number"!=typeof e)throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>Mh||e<Dh)throw new Error("invalid int 32: "+e)}function Bh(e){if("number"!=typeof e)throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>Ph||e<0)throw new Error("invalid uint 32: "+e)}function Fh(e){if("number"!=typeof e)throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>Lh||e<Ch))throw new Error("invalid float 32: "+e)}const Uh=Symbol("@bufbuild/protobuf/enum-type");function Gh(e){const t=e[Uh];return Rh(t,"missing enum type on enum object"),t}function qh(e,t,n,r){e[Uh]=Wh(t,n.map((t=>({no:t.no,name:t.name,localName:e[t.no]}))),r)}function Wh(e,t,n){const r=Object.create(null),i=Object.create(null),o=[];for(const s of t){const e=Vh(s);o.push(e),r[s.name]=e,i[s.no]=e}return{typeName:e,values:o,findName:e=>r[e],findNumber:e=>i[e]}}function zh(e,t,n){const r={};for(const i of t){const e=Vh(i);r[e.localName]=e.no,r[e.no]=e.localName}return qh(r,e,t,n),r}function Vh(e){return"localName"in e?e:Object.assign(Object.assign({},e),{localName:e.name})}function Jh(){let e=0,t=0;for(let r=0;r<28;r+=7){let n=this.buf[this.pos++];if(e|=(127&n)<<r,!(128&n))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(15&n)<<28,t=(112&n)>>4,!(128&n))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let n=this.buf[this.pos++];if(t|=(127&n)<<r,!(128&n))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Hh(e,t,n){for(let o=0;o<28;o+=7){const r=e>>>o,i=!(r>>>7==0&&0==t),s=255&(i?128|r:r);if(n.push(s),!i)return}const r=e>>>28&15|(7&t)<<4,i=!!(t>>3);if(n.push(255&(i?128|r:r)),i){for(let e=3;e<31;e+=7){const r=t>>>e,i=!(r>>>7==0),o=255&(i?128|r:r);if(n.push(o),!i)return}n.push(t>>>31&1)}}const Kh=4294967296;function $h(e){const t="-"===e[0];t&&(e=e.slice(1));const n=1e6;let r=0,i=0;function o(t,o){const s=Number(e.slice(t,o));i*=n,r=r*n+s,r>=Kh&&(i+=r/Kh|0,r%=Kh)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?Qh(r,i):Xh(r,i)}function Yh(e,t){if(({lo:e,hi:t}=function(e,t){return{lo:e>>>0,hi:t>>>0}}(e,t)),t<=2097151)return String(Kh*t+e);const n=16777215&(e>>>24|t<<8),r=t>>16&65535;let i=(16777215&e)+6777216*n+6710656*r,o=n+8147497*r,s=2*r;const a=1e7;return i>=a&&(o+=Math.floor(i/a),i%=a),o>=a&&(s+=Math.floor(o/a),o%=a),s.toString()+Zh(o)+Zh(i)}function Xh(e,t){return{lo:0|e,hi:0|t}}function Qh(e,t){return t=~t,e?e=1+~e:t+=1,Xh(e,t)}const Zh=e=>{const t=String(e);return"0000000".slice(t.length)+t};function em(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(127&e|128),e>>=7;t.push(1)}}function tm(){let e=this.buf[this.pos++],t=127&e;if(!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,!(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let n=5;128&e&&n<10;n++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const nm=function(){const e=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64&&("object"!=typeof process||"object"!=typeof process.env||"1"!==process.env.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),r=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){const r="bigint"==typeof e?e:BigInt(e);if(r>n||r<t)throw new Error(`int64 invalid: ${e}`);return r},uParse(e){const t="bigint"==typeof e?e:BigInt(e);if(t>i||t<r)throw new Error(`uint64 invalid: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)),uDec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0))}}const t=e=>Rh(/^-?[0-9]+$/.test(e),`int64 invalid: ${e}`),n=e=>Rh(/^[0-9]+$/.test(e),`uint64 invalid: ${e}`);return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),t(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),n(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),t(e),$h(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),n(e),$h(e)),dec:(e,t)=>function(e,t){let n=Xh(e,t);const r=2147483648&n.hi;r&&(n=Qh(n.lo,n.hi));const i=Yh(n.lo,n.hi);return r?"-"+i:i}(e,t),uDec:(e,t)=>Yh(e,t)}}();var rm,im;function om(e,t,n){if(t===n)return!0;if(e==rm.BYTES){if(!(t instanceof Uint8Array&&n instanceof Uint8Array))return!1;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==n[e])return!1;return!0}switch(e){case rm.UINT64:case rm.FIXED64:case rm.INT64:case rm.SFIXED64:case rm.SINT64:return t==n}return!1}function sm(e,t){switch(e){case rm.BOOL:return!1;case rm.UINT64:case rm.FIXED64:case rm.INT64:case rm.SFIXED64:case rm.SINT64:return 0==t?nm.zero:"0";case rm.DOUBLE:case rm.FLOAT:return 0;case rm.BYTES:return new Uint8Array(0);case rm.STRING:return"";default:return 0}}function am(e,t){switch(e){case rm.BOOL:return!1===t;case rm.STRING:return""===t;case rm.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return 0==t}}function cm(e){const t=e.field.localName,n=Object.create(null);return n[t]=function(e){const t=e.field;if(t.repeated)return[];if(void 0!==t.default)return t.default;switch(t.kind){case"enum":return t.T.values[0].no;case"scalar":return sm(t.T,t.L);case"message":const e=t.T,n=new e;return e.fieldWrapper?e.fieldWrapper.unwrapField(n):n;case"map":throw"map fields are not allowed to be extensions"}}(e),[n,()=>n[t]]}function um(e,t,n){fm(t,e);const r=t.runtime.bin.makeReadOptions(n),i=function(e,t){if(!t.repeated&&("enum"==t.kind||"scalar"==t.kind)){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.no)return[e[n]];return[]}return e.filter((e=>e.no===t.no))}(e.getType().runtime.bin.listUnknownFields(e),t.field),[o,s]=cm(t);for(const a of i)t.runtime.bin.readField(o,r.readerFactory(a.data),t.field,a.wireType,r);return s()}function lm(e,t,n,r){fm(t,e);const i=t.runtime.bin.makeReadOptions(r),o=t.runtime.bin.makeWriteOptions(r);if(dm(e,t)){const n=e.getType().runtime.bin.listUnknownFields(e).filter((e=>e.no!=t.field.no));e.getType().runtime.bin.discardUnknownFields(e);for(const t of n)e.getType().runtime.bin.onUnknownField(e,t.no,t.wireType,t.data)}const s=o.writerFactory();let a=t.field;a.opt||a.repeated||"enum"!=a.kind&&"scalar"!=a.kind||(a=Object.assign(Object.assign({},t.field),{opt:!0})),t.runtime.bin.writeField(a,n,s,o);const c=i.readerFactory(s.finish());for(;c.pos<c.len;){const[t,n]=c.tag(),r=c.skip(n,t);e.getType().runtime.bin.onUnknownField(e,t,n,r)}}function dm(e,t){const n=e.getType();return t.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(e).find((e=>e.no==t.field.no))}function fm(e,t){Rh(e.extendee.typeName==t.getType().typeName,`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}function pm(e,t){const n=e.localName;if(e.repeated)return t[n].length>0;if(e.oneof)return t[e.oneof.localName].case===n;switch(e.kind){case"enum":case"scalar":return e.opt||e.req?void 0!==t[n]:"enum"==e.kind?t[n]!==e.T.values[0].no:!am(e.T,t[n]);case"message":return void 0!==t[n];case"map":return Object.keys(t[n]).length>0}}function hm(e,t){const n=e.localName,r=!e.opt&&!e.req;if(e.repeated)t[n]=[];else if(e.oneof)t[e.oneof.localName]={case:void 0};else switch(e.kind){case"map":t[n]={};break;case"enum":t[n]=r?e.T.values[0].no:void 0;break;case"scalar":t[n]=r?sm(e.T,e.L):void 0;break;case"message":t[n]=void 0}}function mm(e,t){if(null===e||"object"!=typeof e)return!1;if(!Object.getOwnPropertyNames(Ah.prototype).every((t=>t in e&&"function"==typeof e[t])))return!1;const n=e.getType();return null!==n&&"function"==typeof n&&"typeName"in n&&"string"==typeof n.typeName&&(void 0===t||n.typeName==t.typeName)}function _m(e,t){return mm(t)||!e.fieldWrapper?t:e.fieldWrapper.wrapField(t)}!function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(rm||(rm={})),function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING"}(im||(im={}));rm.DOUBLE,rm.FLOAT,rm.INT64,rm.UINT64,rm.INT32,rm.UINT32,rm.BOOL,rm.STRING,rm.BYTES;const gm={ignoreUnknownFields:!1},vm={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function ym(e){return e?Object.assign(Object.assign({},gm),e):gm}function bm(e){return e?Object.assign(Object.assign({},vm),e):vm}const wm=Symbol(),km=Symbol();function Em(e){if(null===e)return"null";switch(typeof e){case"object":return Array.isArray(e)?"array":"object";case"string":return e.length>100?"string":`"${e.split('"').join('\\"')}"`;default:return String(e)}}function Sm(e,t,n,r,i){let o=n.localName;if(n.repeated){if(Rh("map"!=n.kind),null===t)return;if(!Array.isArray(t))throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${Em(t)}`);const a=e[o];for(const e of t){if(null===e)throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${Em(e)}`);switch(n.kind){case"message":a.push(n.T.fromJson(e,r));break;case"enum":const t=xm(n.T,e,r.ignoreUnknownFields,!0);t!==km&&a.push(t);break;case"scalar":try{a.push(Im(n.T,e,n.L,!0))}catch(s){let t=`cannot decode field ${i.typeName}.${n.name} from JSON: ${Em(e)}`;throw s instanceof Error&&s.message.length>0&&(t+=`: ${s.message}`),new Error(t)}}}}else if("map"==n.kind){if(null===t)return;if("object"!=typeof t||Array.isArray(t))throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: ${Em(t)}`);const a=e[o];for(const[e,o]of Object.entries(t)){if(null===o)throw new Error(`cannot decode field ${i.typeName}.${n.name} from JSON: map value null`);let c;try{c=Tm(n.K,e)}catch(s){let e=`cannot decode map key for field ${i.typeName}.${n.name} from JSON: ${Em(t)}`;throw s instanceof Error&&s.message.length>0&&(e+=`: ${s.message}`),new Error(e)}switch(n.V.kind){case"message":a[c]=n.V.T.fromJson(o,r);break;case"enum":const e=xm(n.V.T,o,r.ignoreUnknownFields,!0);e!==km&&(a[c]=e);break;case"scalar":try{a[c]=Im(n.V.T,o,im.BIGINT,!0)}catch(s){let e=`cannot decode map value for field ${i.typeName}.${n.name} from JSON: ${Em(t)}`;throw s instanceof Error&&s.message.length>0&&(e+=`: ${s.message}`),new Error(e)}}}}else switch(n.oneof&&(e=e[n.oneof.localName]={case:o},o="value"),n.kind){case"message":const a=n.T;if(null===t&&"google.protobuf.Value"!=a.typeName)return;let c=e[o];mm(c)?c.fromJson(t,r):(e[o]=c=a.fromJson(t,r),a.fieldWrapper&&!n.oneof&&(e[o]=a.fieldWrapper.unwrapField(c)));break;case"enum":const u=xm(n.T,t,r.ignoreUnknownFields,!1);switch(u){case wm:hm(n,e);break;case km:break;default:e[o]=u}break;case"scalar":try{const r=Im(n.T,t,n.L,!1);if(r===wm)hm(n,e);else e[o]=r}catch(s){let e=`cannot decode field ${i.typeName}.${n.name} from JSON: ${Em(t)}`;throw s instanceof Error&&s.message.length>0&&(e+=`: ${s.message}`),new Error(e)}}}function Tm(e,t){if(e===rm.BOOL)switch(t){case"true":t=!0;break;case"false":t=!1}return Im(e,t,im.BIGINT,!0).toString()}function Im(e,t,n,r){if(null===t)return r?sm(e,n):wm;switch(e){case rm.DOUBLE:case rm.FLOAT:if("NaN"===t)return Number.NaN;if("Infinity"===t)return Number.POSITIVE_INFINITY;if("-Infinity"===t)return Number.NEGATIVE_INFINITY;if(""===t)break;if("string"==typeof t&&t.trim().length!==t.length)break;if("string"!=typeof t&&"number"!=typeof t)break;const r=Number(t);if(Number.isNaN(r))break;if(!Number.isFinite(r))break;return e==rm.FLOAT&&Fh(r),r;case rm.INT32:case rm.FIXED32:case rm.SFIXED32:case rm.SINT32:case rm.UINT32:let o;if("number"==typeof t?o=t:"string"==typeof t&&t.length>0&&t.trim().length===t.length&&(o=Number(t)),void 0===o)break;return e==rm.UINT32||e==rm.FIXED32?Bh(o):jh(o),o;case rm.INT64:case rm.SFIXED64:case rm.SINT64:if("number"!=typeof t&&"string"!=typeof t)break;const s=nm.parse(t);return n?s.toString():s;case rm.FIXED64:case rm.UINT64:if("number"!=typeof t&&"string"!=typeof t)break;const a=nm.uParse(t);return n?a.toString():a;case rm.BOOL:if("boolean"!=typeof t)break;return t;case rm.STRING:if("string"!=typeof t)break;try{encodeURIComponent(t)}catch(i){throw new Error("invalid UTF8")}return t;case rm.BYTES:if(""===t)return new Uint8Array(0);if("string"!=typeof t)break;return Nh.dec(t)}throw new Error}function xm(e,t,n,r){if(null===t)return"google.protobuf.NullValue"==e.typeName?0:r?e.values[0].no:wm;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const r=e.findName(t);if(void 0!==r)return r.no;if(n)return km}throw new Error(`cannot decode enum ${e.typeName} from JSON: ${Em(t)}`)}function Om(e){return!(!e.repeated&&"map"!=e.kind)||!e.oneof&&("message"!=e.kind&&(!e.opt&&!e.req))}function Nm(e,t,n){if("map"==e.kind){Rh("object"==typeof t&&null!=t);const r={},i=Object.entries(t);switch(e.V.kind){case"scalar":for(const[n,o]of i)r[n.toString()]=Rm(e.V.T,o);break;case"message":for(const[e,o]of i)r[e.toString()]=o.toJson(n);break;case"enum":const t=e.V.T;for(const[e,o]of i)r[e.toString()]=Am(t,o,n.enumAsInteger)}return n.emitDefaultValues||i.length>0?r:void 0}if(e.repeated){Rh(Array.isArray(t));const r=[];switch(e.kind){case"scalar":for(let n=0;n<t.length;n++)r.push(Rm(e.T,t[n]));break;case"enum":for(let i=0;i<t.length;i++)r.push(Am(e.T,t[i],n.enumAsInteger));break;case"message":for(let e=0;e<t.length;e++)r.push(t[e].toJson(n))}return n.emitDefaultValues||r.length>0?r:void 0}switch(e.kind){case"scalar":return Rm(e.T,t);case"enum":return Am(e.T,t,n.enumAsInteger);case"message":return _m(e.T,t).toJson(n)}}function Am(e,t,n){var r;if(Rh("number"==typeof t),"google.protobuf.NullValue"==e.typeName)return null;if(n)return t;const i=e.findNumber(t);return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:t}function Rm(e,t){switch(e){case rm.INT32:case rm.SFIXED32:case rm.SINT32:case rm.FIXED32:case rm.UINT32:return Rh("number"==typeof t),t;case rm.FLOAT:case rm.DOUBLE:return Rh("number"==typeof t),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case rm.STRING:return Rh("string"==typeof t),t;case rm.BOOL:return Rh("boolean"==typeof t),t;case rm.UINT64:case rm.FIXED64:case rm.INT64:case rm.SFIXED64:case rm.SINT64:return Rh("bigint"==typeof t||"string"==typeof t||"number"==typeof t),t.toString();case rm.BYTES:return Rh(t instanceof Uint8Array),Nh.enc(t)}}var Lm;!function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(Lm||(Lm={}));class Cm{constructor(e){this.stack=[],this.textEncoder=null!=e?e:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let r=0;r<this.chunks.length;r++)e+=this.chunks[r].length;let t=new Uint8Array(e),n=0;for(let r=0;r<this.chunks.length;r++)t.set(this.chunks[r],n),n+=this.chunks[r].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Bh(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return jh(e),em(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){Fh(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){Bh(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){jh(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return jh(e),em(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=nm.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=nm.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=nm.enc(e);return Hh(t.lo,t.hi,this.buf),this}sint64(e){let t=nm.enc(e),n=t.hi>>31;return Hh(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){let t=nm.uEnc(e);return Hh(t.lo,t.hi,this.buf),this}}class Pm{constructor(e,t){this.varint64=Jh,this.uint32=tm,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=null!=t?t:new TextDecoder}tag(){let e=this.uint32(),t=e>>>3,n=7&e;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case Lm.Varint:for(;128&this.buf[this.pos++];);break;case Lm.Bit64:this.pos+=4;case Lm.Bit32:this.pos+=4;break;case Lm.LengthDelimited:let n=this.uint32();this.pos+=n;break;case Lm.StartGroup:for(;;){const[e,n]=this.tag();if(n===Lm.EndGroup){if(void 0!==t&&e!==t)throw new Error("invalid end group tag");break}this.skip(n,e)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return nm.dec(...this.varint64())}uint64(){return nm.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(1&e);return e=(e>>>1|(1&t)<<31)^n,t=t>>>1^n,nm.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return nm.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return nm.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}}const Mm=Symbol("@bufbuild/protobuf/unknown-fields"),Dm={readUnknownFields:!0,readerFactory:e=>new Pm(e)},jm={writeUnknownFields:!0,writerFactory:()=>new Cm};function Bm(e){return e?Object.assign(Object.assign({},Dm),e):Dm}function Fm(e){return e?Object.assign(Object.assign({},jm),e):jm}function Um(e,t,n,r,i){let{repeated:o,localName:s}=n;switch(n.oneof&&((e=e[n.oneof.localName]).case!=s&&delete e.value,e.case=s,s="value"),n.kind){case"scalar":case"enum":const a="enum"==n.kind?rm.INT32:n.T;let c=Wm;if("scalar"==n.kind&&n.L>0&&(c=qm),o){let n=e[s];if(r==Lm.LengthDelimited&&a!=rm.STRING&&a!=rm.BYTES){let e=t.uint32()+t.pos;for(;t.pos<e;)n.push(c(t,a))}else n.push(c(t,a))}else e[s]=c(t,a);break;case"message":const u=n.T;o?e[s].push(Gm(t,new u,i,n)):mm(e[s])?Gm(t,e[s],i,n):(e[s]=Gm(t,new u,i,n),!u.fieldWrapper||n.oneof||n.repeated||(e[s]=u.fieldWrapper.unwrapField(e[s])));break;case"map":let[l,d]=function(e,t,n){const r=t.uint32(),i=t.pos+r;let o,s;for(;t.pos<i;){const[r]=t.tag();switch(r){case 1:o=Wm(t,e.K);break;case 2:switch(e.V.kind){case"scalar":s=Wm(t,e.V.T);break;case"enum":s=t.int32();break;case"message":s=Gm(t,new e.V.T,n,void 0)}}}void 0===o&&(o=sm(e.K,im.BIGINT));"string"!=typeof o&&"number"!=typeof o&&(o=o.toString());if(void 0===s)switch(e.V.kind){case"scalar":s=sm(e.V.T,im.BIGINT);break;case"enum":s=e.V.T.values[0].no;break;case"message":s=new e.V.T}return[o,s]}(n,t,i);e[s][l]=d}}function Gm(e,t,n,r){const i=t.getType().runtime.bin,o=null==r?void 0:r.delimited;return i.readMessage(t,e,o?r.no:e.uint32(),n,o),t}function qm(e,t){const n=Wm(e,t);return"bigint"==typeof n?n.toString():n}function Wm(e,t){switch(t){case rm.STRING:return e.string();case rm.BOOL:return e.bool();case rm.DOUBLE:return e.double();case rm.FLOAT:return e.float();case rm.INT32:return e.int32();case rm.INT64:return e.int64();case rm.UINT64:return e.uint64();case rm.FIXED64:return e.fixed64();case rm.BYTES:return e.bytes();case rm.FIXED32:return e.fixed32();case rm.SFIXED32:return e.sfixed32();case rm.SFIXED64:return e.sfixed64();case rm.SINT64:return e.sint64();case rm.UINT32:return e.uint32();case rm.SINT32:return e.sint32()}}function zm(e,t,n,r){Rh(void 0!==t);const i=e.repeated;switch(e.kind){case"scalar":case"enum":let o="enum"==e.kind?rm.INT32:e.T;if(i)if(Rh(Array.isArray(t)),e.packed)!function(e,t,n,r){if(!r.length)return;e.tag(n,Lm.LengthDelimited).fork();let[,i]=Km(t);for(let o=0;o<r.length;o++)e[i](r[o]);e.join()}(n,o,e.no,t);else for(const r of t)Hm(n,o,e.no,r);else Hm(n,o,e.no,t);break;case"message":if(i){Rh(Array.isArray(t));for(const i of t)Jm(n,r,e,i)}else Jm(n,r,e,t);break;case"map":Rh("object"==typeof t&&null!=t);for(const[i,s]of Object.entries(t))Vm(n,r,e,i,s)}}function Vm(e,t,n,r,i){e.tag(n.no,Lm.LengthDelimited),e.fork();let o=r;switch(n.K){case rm.INT32:case rm.FIXED32:case rm.UINT32:case rm.SFIXED32:case rm.SINT32:o=Number.parseInt(r);break;case rm.BOOL:Rh("true"==r||"false"==r),o="true"==r}switch(Hm(e,n.K,1,o),n.V.kind){case"scalar":Hm(e,n.V.T,2,i);break;case"enum":Hm(e,rm.INT32,2,i);break;case"message":Rh(void 0!==i),e.tag(2,Lm.LengthDelimited).bytes(i.toBinary(t))}e.join()}function Jm(e,t,n,r){const i=_m(n.T,r);n.delimited?e.tag(n.no,Lm.StartGroup).raw(i.toBinary(t)).tag(n.no,Lm.EndGroup):e.tag(n.no,Lm.LengthDelimited).bytes(i.toBinary(t))}function Hm(e,t,n,r){Rh(void 0!==r);let[i,o]=Km(t);e.tag(n,i)[o](r)}function Km(e){let t=Lm.Varint;switch(e){case rm.BYTES:case rm.STRING:t=Lm.LengthDelimited;break;case rm.DOUBLE:case rm.FIXED64:case rm.SFIXED64:t=Lm.Bit64;break;case rm.FIXED32:case rm.SFIXED32:case rm.FLOAT:t=Lm.Bit32}return[t,rm[e].toLowerCase()]}function $m(e){if(void 0===e)return e;if(mm(e))return e.clone();if(e instanceof Uint8Array){const t=new Uint8Array(e.byteLength);return t.set(e),t}return e}function Ym(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Xm(e,t,n){return{syntax:e,json:{makeReadOptions:ym,makeWriteOptions:bm,readMessage(e,t,n,r){if(null==t||Array.isArray(t)||"object"!=typeof t)throw new Error(`cannot decode message ${e.typeName} from JSON: ${Em(t)}`);r=null!=r?r:new e;const i=new Map,o=n.typeRegistry;for(const[s,a]of Object.entries(t)){const t=e.fields.findJsonName(s);if(t){if(t.oneof){if(null===a&&"scalar"==t.kind)continue;const n=i.get(t.oneof);if(void 0!==n)throw new Error(`cannot decode message ${e.typeName} from JSON: multiple keys for oneof "${t.oneof.name}" present: "${n}", "${s}"`);i.set(t.oneof,s)}Sm(r,a,t,n,e)}else{let t=!1;if((null==o?void 0:o.findExtension)&&s.startsWith("[")&&s.endsWith("]")){const i=o.findExtension(s.substring(1,s.length-1));if(i&&i.extendee.typeName==e.typeName){t=!0;const[e,o]=cm(i);Sm(e,a,i.field,n,i),lm(r,i,o(),n)}}if(!t&&!n.ignoreUnknownFields)throw new Error(`cannot decode message ${e.typeName} from JSON: key "${s}" is unknown`)}}return r},writeMessage(e,t){const n=e.getType(),r={};let i;try{for(i of n.fields.byNumber()){if(!pm(i,e)){if(i.req)throw"required field not set";if(!t.emitDefaultValues)continue;if(!Om(i))continue}const n=Nm(i,i.oneof?e[i.oneof.localName].value:e[i.localName],t);void 0!==n&&(r[t.useProtoFieldName?i.name:i.jsonName]=n)}const o=t.typeRegistry;if(null==o?void 0:o.findExtensionFor)for(const i of n.runtime.bin.listUnknownFields(e)){const s=o.findExtensionFor(n.typeName,i.no);if(s&&dm(e,s)){const n=um(e,s,t),i=Nm(s.field,n,t);void 0!==i&&(r[s.field.jsonName]=i)}}}catch(o){const e=i?`cannot encode field ${n.typeName}.${i.name} to JSON`:`cannot encode message ${n.typeName} to JSON`,t=o instanceof Error?o.message:String(o);throw new Error(e+(t.length>0?`: ${t}`:""))}return r},readScalar:(e,t,n)=>Im(e,t,null!=n?n:im.BIGINT,!0),writeScalar(e,t,n){if(void 0!==t)return n||am(e,t)?Rm(e,t):void 0},debug:Em},bin:{makeReadOptions:Bm,makeWriteOptions:Fm,listUnknownFields(e){var t;return null!==(t=e[Mm])&&void 0!==t?t:[]},discardUnknownFields(e){delete e[Mm]},writeUnknownFields(e,t){const n=e[Mm];if(n)for(const r of n)t.tag(r.no,r.wireType).raw(r.data)},onUnknownField(e,t,n,r){const i=e;Array.isArray(i[Mm])||(i[Mm]=[]),i[Mm].push({no:t,wireType:n,data:r})},readMessage(e,t,n,r,i){const o=e.getType(),s=i?t.len:t.pos+n;let a,c;for(;t.pos<s&&([a,c]=t.tag(),!0!==i||c!=Lm.EndGroup);){const n=o.fields.find(a);if(n)Um(e,t,n,c,r);else{const n=t.skip(c,a);r.readUnknownFields&&this.onUnknownField(e,a,c,n)}}if(i&&(c!=Lm.EndGroup||a!==n))throw new Error("invalid end group tag")},readField:Um,writeMessage(e,t,n){const r=e.getType();for(const i of r.fields.byNumber())if(pm(i,e))zm(i,i.oneof?e[i.oneof.localName].value:e[i.localName],t,n);else if(i.req)throw new Error(`cannot encode field ${r.typeName}.${i.name} to binary: required field not set`);return n.writeUnknownFields&&this.writeUnknownFields(e,t),t},writeField(e,t,n,r){void 0!==t&&zm(e,t,n,r)}},util:Object.assign(Object.assign({},{setEnumType:qh,initPartial(e,t){if(void 0===e)return;const n=t.getType();for(const r of n.fields.byMember()){const n=r.localName,i=t,o=e;if(null!=o[n])switch(r.kind){case"oneof":const e=o[n].case;if(void 0===e)continue;const t=r.findField(e);let s=o[n].value;t&&"message"==t.kind&&!mm(s,t.T)?s=new t.T(s):t&&"scalar"===t.kind&&t.T===rm.BYTES&&(s=Ym(s)),i[n]={case:e,value:s};break;case"scalar":case"enum":let a=o[n];r.T===rm.BYTES&&(a=r.repeated?a.map(Ym):Ym(a)),i[n]=a;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===rm.BYTES)for(const[t,r]of Object.entries(o[n]))i[n][t]=Ym(r);else Object.assign(i[n],o[n]);break;case"message":const e=r.V.T;for(const t of Object.keys(o[n])){let r=o[n][t];e.fieldWrapper||(r=new e(r)),i[n][t]=r}}break;case"message":const c=r.T;if(r.repeated)i[n]=o[n].map((e=>mm(e,c)?e:new c(e)));else{const e=o[n];c.fieldWrapper?"google.protobuf.BytesValue"===c.typeName?i[n]=Ym(e):i[n]=e:i[n]=mm(e,c)?e:new c(e)}}}},equals:(e,t,n)=>t===n||!(!t||!n)&&e.fields.byMember().every((e=>{const r=t[e.localName],i=n[e.localName];if(e.repeated){if(r.length!==i.length)return!1;switch(e.kind){case"message":return r.every(((t,n)=>e.T.equals(t,i[n])));case"scalar":return r.every(((t,n)=>om(e.T,t,i[n])));case"enum":return r.every(((e,t)=>om(rm.INT32,e,i[t])))}throw new Error(`repeated cannot contain ${e.kind}`)}switch(e.kind){case"message":return e.T.equals(r,i);case"enum":return om(rm.INT32,r,i);case"scalar":return om(e.T,r,i);case"oneof":if(r.case!==i.case)return!1;const t=e.findField(r.case);if(void 0===t)return!0;switch(t.kind){case"message":return t.T.equals(r.value,i.value);case"enum":return om(rm.INT32,r.value,i.value);case"scalar":return om(t.T,r.value,i.value)}throw new Error(`oneof cannot contain ${t.kind}`);case"map":const n=Object.keys(r).concat(Object.keys(i));switch(e.V.kind){case"message":const t=e.V.T;return n.every((e=>t.equals(r[e],i[e])));case"enum":return n.every((e=>om(rm.INT32,r[e],i[e])));case"scalar":const o=e.V.T;return n.every((e=>om(o,r[e],i[e])))}}})),clone(e){const t=e.getType(),n=new t,r=n;for(const i of t.fields.byMember()){const t=e[i.localName];let n;if(i.repeated)n=t.map($m);else if("map"==i.kind){n=r[i.localName];for(const[e,r]of Object.entries(t))n[e]=$m(r)}else n="oneof"==i.kind?i.findField(t.case)?{case:t.case,value:$m(t.value)}:{case:void 0}:$m(t);r[i.localName]=n}for(const i of t.runtime.bin.listUnknownFields(e))t.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return n}}),{newFieldList:t,initFields:n}),makeMessageType(e,t,n){return function(e,t,n,r){var i;const o=null!==(i=null==r?void 0:r.localName)&&void 0!==i?i:t.substring(t.lastIndexOf(".")+1),s={[o]:function(t){e.util.initFields(this),e.util.initPartial(t,this)}}[o];return Object.setPrototypeOf(s.prototype,new Ah),Object.assign(s,{runtime:e,typeName:t,fields:e.util.newFieldList(n),fromBinary:(e,t)=>(new s).fromBinary(e,t),fromJson:(e,t)=>(new s).fromJson(e,t),fromJsonString:(e,t)=>(new s).fromJsonString(e,t),equals:(t,n)=>e.util.equals(s,t,n)}),s}(this,e,t,n)},makeEnum:zh,makeEnumType:Wh,getEnumType:Gh,makeExtension(e,t,n){return function(e,t,n,r){let i;return{typeName:t,extendee:n,get field(){if(!i){const n="function"==typeof r?r():r;n.name=t.split(".").pop(),n.jsonName=`[${t}]`,i=e.util.newFieldList([n]).list()[0]}return i},runtime:e}}(this,e,t,n)}}}class Qm{constructor(e,t){this._fields=e,this._normalizer=t}findJsonName(e){if(!this.jsonNames){const e={};for(const t of this.list())e[t.jsonName]=e[t.name]=t;this.jsonNames=e}return this.jsonNames[e]}find(e){if(!this.numbers){const e={};for(const t of this.list())e[t.no]=t;this.numbers=e}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort(((e,t)=>e.no-t.no))),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let t;for(const n of this.list())n.oneof?n.oneof!==t&&(t=n.oneof,e.push(t)):e.push(n)}return this.members}}function Zm(e,t){const n=n_(e);return t?n:a_(s_(n))}function e_(e){return Zm(e,!1)}const t_=n_;function n_(e){let t=!1;const n=[];for(let r=0;r<e.length;r++){let i=e.charAt(r);switch(i){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(i),t=!1;break;default:t&&(t=!1,i=i.toUpperCase()),n.push(i)}}return n.join("")}new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","enum","implements","interface","let","package","private","protected","public","static","Object","bigint","number","boolean","string","object","globalThis","Uint8Array","Partial"]);const r_=new Set(["constructor","toString","toJSON","valueOf"]),i_=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),o_=e=>`${e}$`,s_=e=>i_.has(e)?o_(e):e,a_=e=>r_.has(e)?o_(e):e;class c_{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=e_(e)}addField(e){Rh(e.oneof===this,`field ${e.name} not one of ${this.name}`),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let e=0;e<this.fields.length;e++)this._lookup[this.fields[e].localName]=this.fields[e]}return this._lookup[e]}}function u_(e,t){var n,r,i,o,s,a;const c=[];let u;for(const l of"function"==typeof e?e():e){const e=l;if(e.localName=Zm(l.name,void 0!==l.oneof),e.jsonName=null!==(n=l.jsonName)&&void 0!==n?n:t_(l.name),e.repeated=null!==(r=l.repeated)&&void 0!==r&&r,"scalar"==l.kind&&(e.L=null!==(i=l.L)&&void 0!==i?i:im.BIGINT),e.delimited=null!==(o=l.delimited)&&void 0!==o&&o,e.req=null!==(s=l.req)&&void 0!==s&&s,e.opt=null!==(a=l.opt)&&void 0!==a&&a,void 0===l.packed&&(e.packed=!!t&&("enum"==l.kind||"scalar"==l.kind&&l.T!=rm.BYTES&&l.T!=rm.STRING)),void 0!==l.oneof){const t="string"==typeof l.oneof?l.oneof:l.oneof.name;u&&u.name==t||(u=new c_(t)),e.oneof=u,u.addField(e)}c.push(e)}return c}const l_=Xm("proto3",(e=>new Qm(e,(e=>u_(e,!0)))),(e=>{for(const t of e.getType().fields.byMember()){if(t.opt)continue;const n=t.localName,r=e;if(t.repeated)r[n]=[];else switch(t.kind){case"oneof":r[n]={case:void 0};break;case"enum":r[n]=0;break;case"map":r[n]={};break;case"scalar":r[n]=sm(t.T,t.L)}}}));class d_ extends Ah{constructor(e){super(),c(this,"type",0),c(this,"info",void 0),l_.util.initPartial(e,this)}static fromBinary(e,t){return(new d_).fromBinary(e,t)}static fromJson(e,t){return(new d_).fromJson(e,t)}static fromJsonString(e,t){return(new d_).fromJsonString(e,t)}static equals(e,t){return l_.util.equals(d_,e,t)}}c(d_,"runtime",l_),c(d_,"typeName","msg_pb.MetaInfo"),c(d_,"fields",l_.util.newFieldList((()=>[{no:1,name:"type",kind:"scalar",T:5},{no:2,name:"info",kind:"scalar",T:9,opt:!0}])));class f_ extends Ah{constructor(e){super(),c(this,"conversationId",void 0),c(this,"sectionId",void 0),c(this,"messageId",void 0),c(this,"localMessageId",void 0),c(this,"index",void 0),c(this,"secSender",void 0),c(this,"replyId",void 0),c(this,"status",void 0),c(this,"createTime",void 0),c(this,"messageType",void 0),c(this,"contentType",void 0),c(this,"content",void 0),c(this,"ttsContent",void 0),c(this,"ext",{}),c(this,"nextConnectionType",void 0),c(this,"chunkSeq",void 0),c(this,"isDelta",void 0),c(this,"metaInfos",[]),c(this,"localConversationId",void 0),c(this,"botId",void 0),c(this,"appletPayload",{}),c(this,"modelType",void 0),c(this,"updateTime",void 0),c(this,"threadId",void 0),l_.util.initPartial(e,this)}static fromBinary(e,t){return(new f_).fromBinary(e,t)}static fromJson(e,t){return(new f_).fromJson(e,t)}static fromJsonString(e,t){return(new f_).fromJsonString(e,t)}static equals(e,t){return l_.util.equals(f_,e,t)}}c(f_,"runtime",l_),c(f_,"typeName","msg_pb.PushMessage"),c(f_,"fields",l_.util.newFieldList((()=>[{no:1,name:"conversation_id",kind:"scalar",T:9,opt:!0},{no:2,name:"section_id",kind:"scalar",T:9,opt:!0},{no:3,name:"message_id",kind:"scalar",T:9,opt:!0},{no:4,name:"local_message_id",kind:"scalar",T:9,opt:!0},{no:5,name:"index",kind:"scalar",T:3,opt:!0},{no:6,name:"sec_sender",kind:"scalar",T:9,opt:!0},{no:7,name:"reply_id",kind:"scalar",T:9,opt:!0},{no:8,name:"status",kind:"scalar",T:5,opt:!0},{no:9,name:"create_time",kind:"scalar",T:3,opt:!0},{no:10,name:"message_type",kind:"scalar",T:5,opt:!0},{no:11,name:"content_type",kind:"scalar",T:5,opt:!0},{no:12,name:"content",kind:"scalar",T:9,opt:!0},{no:13,name:"tts_content",kind:"scalar",T:9,opt:!0},{no:14,name:"ext",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:15,name:"next_connection_type",kind:"scalar",T:5,opt:!0},{no:16,name:"chunk_seq",kind:"scalar",T:3,opt:!0},{no:17,name:"is_delta",kind:"scalar",T:8,opt:!0},{no:18,name:"meta_infos",kind:"message",T:d_,repeated:!0},{no:19,name:"local_conversation_id",kind:"scalar",T:9,opt:!0},{no:20,name:"bot_id",kind:"scalar",T:9,opt:!0},{no:21,name:"applet_payload",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:22,name:"model_type",kind:"scalar",T:5,opt:!0},{no:23,name:"update_time",kind:"scalar",T:3,opt:!0},{no:24,name:"thread_id",kind:"scalar",T:3,opt:!0}])));class p_ extends Ah{constructor(e){super(),c(this,"cmdType",void 0),c(this,"index",void 0),c(this,"conversationId",void 0),c(this,"messageId",void 0),c(this,"ext",{}),c(this,"upCmdType",void 0),c(this,"localMessageId",void 0),l_.util.initPartial(e,this)}static fromBinary(e,t){return(new p_).fromBinary(e,t)}static fromJson(e,t){return(new p_).fromJson(e,t)}static fromJsonString(e,t){return(new p_).fromJsonString(e,t)}static equals(e,t){return l_.util.equals(p_,e,t)}}c(p_,"runtime",l_),c(p_,"typeName","msg_pb.PushCmd"),c(p_,"fields",l_.util.newFieldList((()=>[{no:1,name:"cmd_type",kind:"scalar",T:5,opt:!0},{no:2,name:"index",kind:"scalar",T:3,opt:!0},{no:3,name:"conversation_id",kind:"scalar",T:9,opt:!0},{no:4,name:"message_id",kind:"scalar",T:9,opt:!0},{no:5,name:"ext",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:6,name:"up_cmd_type",kind:"scalar",T:5,opt:!0},{no:7,name:"local_message_id",kind:"scalar",T:9,opt:!0}])));class h_ extends Ah{constructor(e){super(),c(this,"longitude",void 0),c(this,"latitude",void 0),c(this,"countryName",void 0),c(this,"provinceName",void 0),c(this,"cityName",void 0),c(this,"districtName",void 0),c(this,"townName",void 0),c(this,"countryCode",void 0),l_.util.initPartial(e,this)}static fromBinary(e,t){return(new h_).fromBinary(e,t)}static fromJson(e,t){return(new h_).fromJson(e,t)}static fromJsonString(e,t){return(new h_).fromJsonString(e,t)}static equals(e,t){return l_.util.equals(h_,e,t)}}c(h_,"runtime",l_),c(h_,"typeName","msg_pb.GeoInfo"),c(h_,"fields",l_.util.newFieldList((()=>[{no:1,name:"longitude",kind:"scalar",T:9,opt:!0},{no:2,name:"latitude",kind:"scalar",T:9,opt:!0},{no:3,name:"country_name",kind:"scalar",T:9,opt:!0},{no:4,name:"province_name",kind:"scalar",T:9,opt:!0},{no:5,name:"city_name",kind:"scalar",T:9,opt:!0},{no:6,name:"district_name",kind:"scalar",T:9,opt:!0},{no:7,name:"town_name",kind:"scalar",T:9,opt:!0},{no:8,name:"country_code",kind:"scalar",T:9,opt:!0}])));class m_ extends Ah{constructor(e){super(),c(this,"messageId",void 0),c(this,"localMessageId",void 0),c(this,"replyId",void 0),c(this,"questionId",void 0),c(this,"createTime",void 0),c(this,"content",void 0),c(this,"ext",{}),c(this,"messageType",void 0),l_.util.initPartial(e,this)}static fromBinary(e,t){return(new m_).fromBinary(e,t)}static fromJson(e,t){return(new m_).fromJson(e,t)}static fromJsonString(e,t){return(new m_).fromJsonString(e,t)}static equals(e,t){return l_.util.equals(m_,e,t)}}c(m_,"runtime",l_),c(m_,"typeName","msg_pb.AppAction"),c(m_,"fields",l_.util.newFieldList((()=>[{no:1,name:"message_id",kind:"scalar",T:3,opt:!0},{no:2,name:"local_message_id",kind:"scalar",T:9,opt:!0},{no:3,name:"reply_id",kind:"scalar",T:3,opt:!0},{no:4,name:"question_id",kind:"scalar",T:3,opt:!0},{no:5,name:"create_time",kind:"scalar",T:3,opt:!0},{no:6,name:"content",kind:"scalar",T:9,opt:!0},{no:7,name:"ext",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:8,name:"message_type",kind:"scalar",T:5,opt:!0}])));class __ extends Ah{constructor(e){super(),c(this,"eventType",0),c(this,"message",void 0),c(this,"cmd",void 0),c(this,"geo",void 0),c(this,"appAction",void 0),c(this,"version",void 0),c(this,"messageList",[]),l_.util.initPartial(e,this)}static fromBinary(e,t){return(new __).fromBinary(e,t)}static fromJson(e,t){return(new __).fromJson(e,t)}static fromJsonString(e,t){return(new __).fromJsonString(e,t)}static equals(e,t){return l_.util.equals(__,e,t)}}c(__,"runtime",l_),c(__,"typeName","msg_pb.PushEvent"),c(__,"fields",l_.util.newFieldList((()=>[{no:1,name:"event_type",kind:"scalar",T:5},{no:2,name:"message",kind:"message",T:f_,opt:!0},{no:3,name:"cmd",kind:"message",T:p_,opt:!0},{no:4,name:"geo",kind:"message",T:h_,opt:!0},{no:5,name:"app_action",kind:"message",T:m_,opt:!0},{no:6,name:"version",kind:"scalar",T:5,opt:!0},{no:7,name:"message_list",kind:"message",T:f_,repeated:!0}])));const g_=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1};const v_=function(e){return e!=e};const y_=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1};const b_=function(e,t,n){return t==t?y_(e,t,n):g_(e,v_,n)};const w_=function(e,t){return!!(null==e?0:e.length)&&b_(e,t,0)>-1};const k_=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1};const E_=fe&&1/ln(new fe([,-0]))[1]==1/0?function(e){return new fe(e)}:Jd;const S_=function(e,t,n){var r=-1,i=w_,o=e.length,s=!0,a=[],c=a;if(n)s=!1,i=k_;else if(o>=200){var u=t?null:E_(e);if(u)return ln(u);s=!1,i=sn,c=new rn}else c=t?[]:a;e:for(;++r<o;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,s&&d==d){for(var f=c.length;f--;)if(c[f]===d)continue e;t&&c.push(d),a.push(l)}else i(c,d,n)||(c!==a&&c.push(d),a.push(l))}return a};const T_=function(e){return e&&e.length?S_(e):[]},I_={length(e){let t=0,n=0;for(let r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},read(e,t,n){if(n-t<1)return"";let r="";for(let i=t;i<n;){const t=e[i++];if(t<=127)r+=String.fromCharCode(t);else if(t>=192&&t<224)r+=String.fromCharCode((31&t)<<6|63&e[i++]);else if(t>=224&&t<240)r+=String.fromCharCode((15&t)<<12|(63&e[i++])<<6|63&e[i++]);else if(t>=240){const n=((7&t)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536;r+=String.fromCharCode(55296+(n>>10)),r+=String.fromCharCode(56320+(1023&n))}}return r},write(e,t,n){const r=n;let i,o;for(let s=0;s<e.length;++s)i=e.charCodeAt(s),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&56320==(64512&(o=e.charCodeAt(s+1)))?(i=65536+((1023&i)<<10)+(1023&o),++s,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128);return n-r},posCalcRange(e,t){let n=0;const r={};let i=Pp(t);i=T_(i.sort(((e,t)=>e-t)));for(let o=0;o<e.length&&(n===i[0]&&(r[i[0]]=o,i.shift()),55296==(64512&e[o].charCodeAt(0))&&56320==(64512&e[o+1].charCodeAt(0))?(n+=this.length(`${e[o]}${e[o+1]}`),o++):n+=this.length(e[o]),i.length);o++);return r},posCalc(e,t){let n="",r=0;for(let i=0;i<e.length;i++)if(n+=e[i],this.length(n)===t)return r=i+1,r;return r}},x_=e=>new Pm(e,{decode:e=>e?I_.read(e,0,e.byteLength):""});function O_(e){return __.fromBinary(Nh.dec(e),{readerFactory:x_}).toJson({useProtoFieldName:!0})}const N_=Xm("proto2",(e=>new Qm(e,(e=>u_(e,!1)))),(e=>{for(const t of e.getType().fields.byMember()){const n=t.localName,r=e;if(t.repeated)r[n]=[];else switch(t.kind){case"oneof":r[n]={case:void 0};break;case"map":r[n]={}}}}));var A_,R_,L_,C_,P_,M_,D_,j_,B_,F_,U_,G_,q_,W_,z_,V_,J_;!function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"}(A_||(A_={})),N_.util.setEnumType(A_,"google.protobuf.Edition",[{no:0,name:"EDITION_UNKNOWN"},{no:900,name:"EDITION_LEGACY"},{no:998,name:"EDITION_PROTO2"},{no:999,name:"EDITION_PROTO3"},{no:1e3,name:"EDITION_2023"},{no:1001,name:"EDITION_2024"},{no:1,name:"EDITION_1_TEST_ONLY"},{no:2,name:"EDITION_2_TEST_ONLY"},{no:99997,name:"EDITION_99997_TEST_ONLY"},{no:99998,name:"EDITION_99998_TEST_ONLY"},{no:99999,name:"EDITION_99999_TEST_ONLY"},{no:2147483647,name:"EDITION_MAX"}]);class H_ extends Ah{constructor(e){super(),this.file=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new H_).fromBinary(e,t)}static fromJson(e,t){return(new H_).fromJson(e,t)}static fromJsonString(e,t){return(new H_).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(H_,e,t)}}H_.runtime=N_,H_.typeName="google.protobuf.FileDescriptorSet",H_.fields=N_.util.newFieldList((()=>[{no:1,name:"file",kind:"message",T:K_,repeated:!0}]));class K_ extends Ah{constructor(e){super(),this.dependency=[],this.publicDependency=[],this.weakDependency=[],this.messageType=[],this.enumType=[],this.service=[],this.extension=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new K_).fromBinary(e,t)}static fromJson(e,t){return(new K_).fromJson(e,t)}static fromJsonString(e,t){return(new K_).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(K_,e,t)}}K_.runtime=N_,K_.typeName="google.protobuf.FileDescriptorProto",K_.fields=N_.util.newFieldList((()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"package",kind:"scalar",T:9,opt:!0},{no:3,name:"dependency",kind:"scalar",T:9,repeated:!0},{no:10,name:"public_dependency",kind:"scalar",T:5,repeated:!0},{no:11,name:"weak_dependency",kind:"scalar",T:5,repeated:!0},{no:4,name:"message_type",kind:"message",T:$_,repeated:!0},{no:5,name:"enum_type",kind:"message",T:ng,repeated:!0},{no:6,name:"service",kind:"message",T:og,repeated:!0},{no:7,name:"extension",kind:"message",T:eg,repeated:!0},{no:8,name:"options",kind:"message",T:ag,opt:!0},{no:9,name:"source_code_info",kind:"message",T:kg,opt:!0},{no:12,name:"syntax",kind:"scalar",T:9,opt:!0},{no:14,name:"edition",kind:"enum",T:N_.getEnumType(A_),opt:!0}]));class $_ extends Ah{constructor(e){super(),this.field=[],this.extension=[],this.nestedType=[],this.enumType=[],this.extensionRange=[],this.oneofDecl=[],this.reservedRange=[],this.reservedName=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new $_).fromBinary(e,t)}static fromJson(e,t){return(new $_).fromJson(e,t)}static fromJsonString(e,t){return(new $_).fromJsonString(e,t)}static equals(e,t){return N_.util.equals($_,e,t)}}$_.runtime=N_,$_.typeName="google.protobuf.DescriptorProto",$_.fields=N_.util.newFieldList((()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"field",kind:"message",T:eg,repeated:!0},{no:6,name:"extension",kind:"message",T:eg,repeated:!0},{no:3,name:"nested_type",kind:"message",T:$_,repeated:!0},{no:4,name:"enum_type",kind:"message",T:ng,repeated:!0},{no:5,name:"extension_range",kind:"message",T:Y_,repeated:!0},{no:8,name:"oneof_decl",kind:"message",T:tg,repeated:!0},{no:7,name:"options",kind:"message",T:cg,opt:!0},{no:9,name:"reserved_range",kind:"message",T:X_,repeated:!0},{no:10,name:"reserved_name",kind:"scalar",T:9,repeated:!0}]));class Y_ extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new Y_).fromBinary(e,t)}static fromJson(e,t){return(new Y_).fromJson(e,t)}static fromJsonString(e,t){return(new Y_).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(Y_,e,t)}}Y_.runtime=N_,Y_.typeName="google.protobuf.DescriptorProto.ExtensionRange",Y_.fields=N_.util.newFieldList((()=>[{no:1,name:"start",kind:"scalar",T:5,opt:!0},{no:2,name:"end",kind:"scalar",T:5,opt:!0},{no:3,name:"options",kind:"message",T:Q_,opt:!0}]));class X_ extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new X_).fromBinary(e,t)}static fromJson(e,t){return(new X_).fromJson(e,t)}static fromJsonString(e,t){return(new X_).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(X_,e,t)}}X_.runtime=N_,X_.typeName="google.protobuf.DescriptorProto.ReservedRange",X_.fields=N_.util.newFieldList((()=>[{no:1,name:"start",kind:"scalar",T:5,opt:!0},{no:2,name:"end",kind:"scalar",T:5,opt:!0}]));class Q_ extends Ah{constructor(e){super(),this.uninterpretedOption=[],this.declaration=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new Q_).fromBinary(e,t)}static fromJson(e,t){return(new Q_).fromJson(e,t)}static fromJsonString(e,t){return(new Q_).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(Q_,e,t)}}Q_.runtime=N_,Q_.typeName="google.protobuf.ExtensionRangeOptions",Q_.fields=N_.util.newFieldList((()=>[{no:999,name:"uninterpreted_option",kind:"message",T:gg,repeated:!0},{no:2,name:"declaration",kind:"message",T:Z_,repeated:!0},{no:50,name:"features",kind:"message",T:yg,opt:!0},{no:3,name:"verification",kind:"enum",T:N_.getEnumType(R_),opt:!0,default:R_.UNVERIFIED}])),function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"}(R_||(R_={})),N_.util.setEnumType(R_,"google.protobuf.ExtensionRangeOptions.VerificationState",[{no:0,name:"DECLARATION"},{no:1,name:"UNVERIFIED"}]);class Z_ extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new Z_).fromBinary(e,t)}static fromJson(e,t){return(new Z_).fromJson(e,t)}static fromJsonString(e,t){return(new Z_).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(Z_,e,t)}}Z_.runtime=N_,Z_.typeName="google.protobuf.ExtensionRangeOptions.Declaration",Z_.fields=N_.util.newFieldList((()=>[{no:1,name:"number",kind:"scalar",T:5,opt:!0},{no:2,name:"full_name",kind:"scalar",T:9,opt:!0},{no:3,name:"type",kind:"scalar",T:9,opt:!0},{no:5,name:"reserved",kind:"scalar",T:8,opt:!0},{no:6,name:"repeated",kind:"scalar",T:8,opt:!0}]));class eg extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new eg).fromBinary(e,t)}static fromJson(e,t){return(new eg).fromJson(e,t)}static fromJsonString(e,t){return(new eg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(eg,e,t)}}eg.runtime=N_,eg.typeName="google.protobuf.FieldDescriptorProto",eg.fields=N_.util.newFieldList((()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:3,name:"number",kind:"scalar",T:5,opt:!0},{no:4,name:"label",kind:"enum",T:N_.getEnumType(C_),opt:!0},{no:5,name:"type",kind:"enum",T:N_.getEnumType(L_),opt:!0},{no:6,name:"type_name",kind:"scalar",T:9,opt:!0},{no:2,name:"extendee",kind:"scalar",T:9,opt:!0},{no:7,name:"default_value",kind:"scalar",T:9,opt:!0},{no:9,name:"oneof_index",kind:"scalar",T:5,opt:!0},{no:10,name:"json_name",kind:"scalar",T:9,opt:!0},{no:8,name:"options",kind:"message",T:ug,opt:!0},{no:17,name:"proto3_optional",kind:"scalar",T:8,opt:!0}])),function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(L_||(L_={})),N_.util.setEnumType(L_,"google.protobuf.FieldDescriptorProto.Type",[{no:1,name:"TYPE_DOUBLE"},{no:2,name:"TYPE_FLOAT"},{no:3,name:"TYPE_INT64"},{no:4,name:"TYPE_UINT64"},{no:5,name:"TYPE_INT32"},{no:6,name:"TYPE_FIXED64"},{no:7,name:"TYPE_FIXED32"},{no:8,name:"TYPE_BOOL"},{no:9,name:"TYPE_STRING"},{no:10,name:"TYPE_GROUP"},{no:11,name:"TYPE_MESSAGE"},{no:12,name:"TYPE_BYTES"},{no:13,name:"TYPE_UINT32"},{no:14,name:"TYPE_ENUM"},{no:15,name:"TYPE_SFIXED32"},{no:16,name:"TYPE_SFIXED64"},{no:17,name:"TYPE_SINT32"},{no:18,name:"TYPE_SINT64"}]),function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"}(C_||(C_={})),N_.util.setEnumType(C_,"google.protobuf.FieldDescriptorProto.Label",[{no:1,name:"LABEL_OPTIONAL"},{no:3,name:"LABEL_REPEATED"},{no:2,name:"LABEL_REQUIRED"}]);class tg extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new tg).fromBinary(e,t)}static fromJson(e,t){return(new tg).fromJson(e,t)}static fromJsonString(e,t){return(new tg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(tg,e,t)}}tg.runtime=N_,tg.typeName="google.protobuf.OneofDescriptorProto",tg.fields=N_.util.newFieldList((()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"options",kind:"message",T:fg,opt:!0}]));class ng extends Ah{constructor(e){super(),this.value=[],this.reservedRange=[],this.reservedName=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new ng).fromBinary(e,t)}static fromJson(e,t){return(new ng).fromJson(e,t)}static fromJsonString(e,t){return(new ng).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(ng,e,t)}}ng.runtime=N_,ng.typeName="google.protobuf.EnumDescriptorProto",ng.fields=N_.util.newFieldList((()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"value",kind:"message",T:ig,repeated:!0},{no:3,name:"options",kind:"message",T:pg,opt:!0},{no:4,name:"reserved_range",kind:"message",T:rg,repeated:!0},{no:5,name:"reserved_name",kind:"scalar",T:9,repeated:!0}]));class rg extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new rg).fromBinary(e,t)}static fromJson(e,t){return(new rg).fromJson(e,t)}static fromJsonString(e,t){return(new rg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(rg,e,t)}}rg.runtime=N_,rg.typeName="google.protobuf.EnumDescriptorProto.EnumReservedRange",rg.fields=N_.util.newFieldList((()=>[{no:1,name:"start",kind:"scalar",T:5,opt:!0},{no:2,name:"end",kind:"scalar",T:5,opt:!0}]));class ig extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new ig).fromBinary(e,t)}static fromJson(e,t){return(new ig).fromJson(e,t)}static fromJsonString(e,t){return(new ig).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(ig,e,t)}}ig.runtime=N_,ig.typeName="google.protobuf.EnumValueDescriptorProto",ig.fields=N_.util.newFieldList((()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"number",kind:"scalar",T:5,opt:!0},{no:3,name:"options",kind:"message",T:hg,opt:!0}]));class og extends Ah{constructor(e){super(),this.method=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new og).fromBinary(e,t)}static fromJson(e,t){return(new og).fromJson(e,t)}static fromJsonString(e,t){return(new og).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(og,e,t)}}og.runtime=N_,og.typeName="google.protobuf.ServiceDescriptorProto",og.fields=N_.util.newFieldList((()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"method",kind:"message",T:sg,repeated:!0},{no:3,name:"options",kind:"message",T:mg,opt:!0}]));class sg extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new sg).fromBinary(e,t)}static fromJson(e,t){return(new sg).fromJson(e,t)}static fromJsonString(e,t){return(new sg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(sg,e,t)}}sg.runtime=N_,sg.typeName="google.protobuf.MethodDescriptorProto",sg.fields=N_.util.newFieldList((()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"input_type",kind:"scalar",T:9,opt:!0},{no:3,name:"output_type",kind:"scalar",T:9,opt:!0},{no:4,name:"options",kind:"message",T:_g,opt:!0},{no:5,name:"client_streaming",kind:"scalar",T:8,opt:!0,default:!1},{no:6,name:"server_streaming",kind:"scalar",T:8,opt:!0,default:!1}]));class ag extends Ah{constructor(e){super(),this.uninterpretedOption=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new ag).fromBinary(e,t)}static fromJson(e,t){return(new ag).fromJson(e,t)}static fromJsonString(e,t){return(new ag).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(ag,e,t)}}ag.runtime=N_,ag.typeName="google.protobuf.FileOptions",ag.fields=N_.util.newFieldList((()=>[{no:1,name:"java_package",kind:"scalar",T:9,opt:!0},{no:8,name:"java_outer_classname",kind:"scalar",T:9,opt:!0},{no:10,name:"java_multiple_files",kind:"scalar",T:8,opt:!0,default:!1},{no:20,name:"java_generate_equals_and_hash",kind:"scalar",T:8,opt:!0},{no:27,name:"java_string_check_utf8",kind:"scalar",T:8,opt:!0,default:!1},{no:9,name:"optimize_for",kind:"enum",T:N_.getEnumType(P_),opt:!0,default:P_.SPEED},{no:11,name:"go_package",kind:"scalar",T:9,opt:!0},{no:16,name:"cc_generic_services",kind:"scalar",T:8,opt:!0,default:!1},{no:17,name:"java_generic_services",kind:"scalar",T:8,opt:!0,default:!1},{no:18,name:"py_generic_services",kind:"scalar",T:8,opt:!0,default:!1},{no:23,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:31,name:"cc_enable_arenas",kind:"scalar",T:8,opt:!0,default:!0},{no:36,name:"objc_class_prefix",kind:"scalar",T:9,opt:!0},{no:37,name:"csharp_namespace",kind:"scalar",T:9,opt:!0},{no:39,name:"swift_prefix",kind:"scalar",T:9,opt:!0},{no:40,name:"php_class_prefix",kind:"scalar",T:9,opt:!0},{no:41,name:"php_namespace",kind:"scalar",T:9,opt:!0},{no:44,name:"php_metadata_namespace",kind:"scalar",T:9,opt:!0},{no:45,name:"ruby_package",kind:"scalar",T:9,opt:!0},{no:50,name:"features",kind:"message",T:yg,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:gg,repeated:!0}])),function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"}(P_||(P_={})),N_.util.setEnumType(P_,"google.protobuf.FileOptions.OptimizeMode",[{no:1,name:"SPEED"},{no:2,name:"CODE_SIZE"},{no:3,name:"LITE_RUNTIME"}]);class cg extends Ah{constructor(e){super(),this.uninterpretedOption=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new cg).fromBinary(e,t)}static fromJson(e,t){return(new cg).fromJson(e,t)}static fromJsonString(e,t){return(new cg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(cg,e,t)}}cg.runtime=N_,cg.typeName="google.protobuf.MessageOptions",cg.fields=N_.util.newFieldList((()=>[{no:1,name:"message_set_wire_format",kind:"scalar",T:8,opt:!0,default:!1},{no:2,name:"no_standard_descriptor_accessor",kind:"scalar",T:8,opt:!0,default:!1},{no:3,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:7,name:"map_entry",kind:"scalar",T:8,opt:!0},{no:11,name:"deprecated_legacy_json_field_conflicts",kind:"scalar",T:8,opt:!0},{no:12,name:"features",kind:"message",T:yg,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:gg,repeated:!0}]));class ug extends Ah{constructor(e){super(),this.targets=[],this.editionDefaults=[],this.uninterpretedOption=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new ug).fromBinary(e,t)}static fromJson(e,t){return(new ug).fromJson(e,t)}static fromJsonString(e,t){return(new ug).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(ug,e,t)}}ug.runtime=N_,ug.typeName="google.protobuf.FieldOptions",ug.fields=N_.util.newFieldList((()=>[{no:1,name:"ctype",kind:"enum",T:N_.getEnumType(M_),opt:!0,default:M_.STRING},{no:2,name:"packed",kind:"scalar",T:8,opt:!0},{no:6,name:"jstype",kind:"enum",T:N_.getEnumType(D_),opt:!0,default:D_.JS_NORMAL},{no:5,name:"lazy",kind:"scalar",T:8,opt:!0,default:!1},{no:15,name:"unverified_lazy",kind:"scalar",T:8,opt:!0,default:!1},{no:3,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:10,name:"weak",kind:"scalar",T:8,opt:!0,default:!1},{no:16,name:"debug_redact",kind:"scalar",T:8,opt:!0,default:!1},{no:17,name:"retention",kind:"enum",T:N_.getEnumType(j_),opt:!0},{no:19,name:"targets",kind:"enum",T:N_.getEnumType(B_),repeated:!0},{no:20,name:"edition_defaults",kind:"message",T:lg,repeated:!0},{no:21,name:"features",kind:"message",T:yg,opt:!0},{no:22,name:"feature_support",kind:"message",T:dg,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:gg,repeated:!0}])),function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"}(M_||(M_={})),N_.util.setEnumType(M_,"google.protobuf.FieldOptions.CType",[{no:0,name:"STRING"},{no:1,name:"CORD"},{no:2,name:"STRING_PIECE"}]),function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"}(D_||(D_={})),N_.util.setEnumType(D_,"google.protobuf.FieldOptions.JSType",[{no:0,name:"JS_NORMAL"},{no:1,name:"JS_STRING"},{no:2,name:"JS_NUMBER"}]),function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"}(j_||(j_={})),N_.util.setEnumType(j_,"google.protobuf.FieldOptions.OptionRetention",[{no:0,name:"RETENTION_UNKNOWN"},{no:1,name:"RETENTION_RUNTIME"},{no:2,name:"RETENTION_SOURCE"}]),function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"}(B_||(B_={})),N_.util.setEnumType(B_,"google.protobuf.FieldOptions.OptionTargetType",[{no:0,name:"TARGET_TYPE_UNKNOWN"},{no:1,name:"TARGET_TYPE_FILE"},{no:2,name:"TARGET_TYPE_EXTENSION_RANGE"},{no:3,name:"TARGET_TYPE_MESSAGE"},{no:4,name:"TARGET_TYPE_FIELD"},{no:5,name:"TARGET_TYPE_ONEOF"},{no:6,name:"TARGET_TYPE_ENUM"},{no:7,name:"TARGET_TYPE_ENUM_ENTRY"},{no:8,name:"TARGET_TYPE_SERVICE"},{no:9,name:"TARGET_TYPE_METHOD"}]);class lg extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new lg).fromBinary(e,t)}static fromJson(e,t){return(new lg).fromJson(e,t)}static fromJsonString(e,t){return(new lg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(lg,e,t)}}lg.runtime=N_,lg.typeName="google.protobuf.FieldOptions.EditionDefault",lg.fields=N_.util.newFieldList((()=>[{no:3,name:"edition",kind:"enum",T:N_.getEnumType(A_),opt:!0},{no:2,name:"value",kind:"scalar",T:9,opt:!0}]));class dg extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new dg).fromBinary(e,t)}static fromJson(e,t){return(new dg).fromJson(e,t)}static fromJsonString(e,t){return(new dg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(dg,e,t)}}dg.runtime=N_,dg.typeName="google.protobuf.FieldOptions.FeatureSupport",dg.fields=N_.util.newFieldList((()=>[{no:1,name:"edition_introduced",kind:"enum",T:N_.getEnumType(A_),opt:!0},{no:2,name:"edition_deprecated",kind:"enum",T:N_.getEnumType(A_),opt:!0},{no:3,name:"deprecation_warning",kind:"scalar",T:9,opt:!0},{no:4,name:"edition_removed",kind:"enum",T:N_.getEnumType(A_),opt:!0}]));class fg extends Ah{constructor(e){super(),this.uninterpretedOption=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new fg).fromBinary(e,t)}static fromJson(e,t){return(new fg).fromJson(e,t)}static fromJsonString(e,t){return(new fg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(fg,e,t)}}fg.runtime=N_,fg.typeName="google.protobuf.OneofOptions",fg.fields=N_.util.newFieldList((()=>[{no:1,name:"features",kind:"message",T:yg,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:gg,repeated:!0}]));class pg extends Ah{constructor(e){super(),this.uninterpretedOption=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new pg).fromBinary(e,t)}static fromJson(e,t){return(new pg).fromJson(e,t)}static fromJsonString(e,t){return(new pg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(pg,e,t)}}pg.runtime=N_,pg.typeName="google.protobuf.EnumOptions",pg.fields=N_.util.newFieldList((()=>[{no:2,name:"allow_alias",kind:"scalar",T:8,opt:!0},{no:3,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:6,name:"deprecated_legacy_json_field_conflicts",kind:"scalar",T:8,opt:!0},{no:7,name:"features",kind:"message",T:yg,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:gg,repeated:!0}]));class hg extends Ah{constructor(e){super(),this.uninterpretedOption=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new hg).fromBinary(e,t)}static fromJson(e,t){return(new hg).fromJson(e,t)}static fromJsonString(e,t){return(new hg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(hg,e,t)}}hg.runtime=N_,hg.typeName="google.protobuf.EnumValueOptions",hg.fields=N_.util.newFieldList((()=>[{no:1,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:2,name:"features",kind:"message",T:yg,opt:!0},{no:3,name:"debug_redact",kind:"scalar",T:8,opt:!0,default:!1},{no:4,name:"feature_support",kind:"message",T:dg,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:gg,repeated:!0}]));class mg extends Ah{constructor(e){super(),this.uninterpretedOption=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new mg).fromBinary(e,t)}static fromJson(e,t){return(new mg).fromJson(e,t)}static fromJsonString(e,t){return(new mg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(mg,e,t)}}mg.runtime=N_,mg.typeName="google.protobuf.ServiceOptions",mg.fields=N_.util.newFieldList((()=>[{no:34,name:"features",kind:"message",T:yg,opt:!0},{no:33,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:999,name:"uninterpreted_option",kind:"message",T:gg,repeated:!0}]));class _g extends Ah{constructor(e){super(),this.uninterpretedOption=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new _g).fromBinary(e,t)}static fromJson(e,t){return(new _g).fromJson(e,t)}static fromJsonString(e,t){return(new _g).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(_g,e,t)}}_g.runtime=N_,_g.typeName="google.protobuf.MethodOptions",_g.fields=N_.util.newFieldList((()=>[{no:33,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:34,name:"idempotency_level",kind:"enum",T:N_.getEnumType(F_),opt:!0,default:F_.IDEMPOTENCY_UNKNOWN},{no:35,name:"features",kind:"message",T:yg,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:gg,repeated:!0}])),function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"}(F_||(F_={})),N_.util.setEnumType(F_,"google.protobuf.MethodOptions.IdempotencyLevel",[{no:0,name:"IDEMPOTENCY_UNKNOWN"},{no:1,name:"NO_SIDE_EFFECTS"},{no:2,name:"IDEMPOTENT"}]);class gg extends Ah{constructor(e){super(),this.name=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new gg).fromBinary(e,t)}static fromJson(e,t){return(new gg).fromJson(e,t)}static fromJsonString(e,t){return(new gg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(gg,e,t)}}gg.runtime=N_,gg.typeName="google.protobuf.UninterpretedOption",gg.fields=N_.util.newFieldList((()=>[{no:2,name:"name",kind:"message",T:vg,repeated:!0},{no:3,name:"identifier_value",kind:"scalar",T:9,opt:!0},{no:4,name:"positive_int_value",kind:"scalar",T:4,opt:!0},{no:5,name:"negative_int_value",kind:"scalar",T:3,opt:!0},{no:6,name:"double_value",kind:"scalar",T:1,opt:!0},{no:7,name:"string_value",kind:"scalar",T:12,opt:!0},{no:8,name:"aggregate_value",kind:"scalar",T:9,opt:!0}]));class vg extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new vg).fromBinary(e,t)}static fromJson(e,t){return(new vg).fromJson(e,t)}static fromJsonString(e,t){return(new vg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(vg,e,t)}}vg.runtime=N_,vg.typeName="google.protobuf.UninterpretedOption.NamePart",vg.fields=N_.util.newFieldList((()=>[{no:1,name:"name_part",kind:"scalar",T:9,req:!0},{no:2,name:"is_extension",kind:"scalar",T:8,req:!0}]));class yg extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new yg).fromBinary(e,t)}static fromJson(e,t){return(new yg).fromJson(e,t)}static fromJsonString(e,t){return(new yg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(yg,e,t)}}yg.runtime=N_,yg.typeName="google.protobuf.FeatureSet",yg.fields=N_.util.newFieldList((()=>[{no:1,name:"field_presence",kind:"enum",T:N_.getEnumType(U_),opt:!0},{no:2,name:"enum_type",kind:"enum",T:N_.getEnumType(G_),opt:!0},{no:3,name:"repeated_field_encoding",kind:"enum",T:N_.getEnumType(q_),opt:!0},{no:4,name:"utf8_validation",kind:"enum",T:N_.getEnumType(W_),opt:!0},{no:5,name:"message_encoding",kind:"enum",T:N_.getEnumType(z_),opt:!0},{no:6,name:"json_format",kind:"enum",T:N_.getEnumType(V_),opt:!0}])),function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"}(U_||(U_={})),N_.util.setEnumType(U_,"google.protobuf.FeatureSet.FieldPresence",[{no:0,name:"FIELD_PRESENCE_UNKNOWN"},{no:1,name:"EXPLICIT"},{no:2,name:"IMPLICIT"},{no:3,name:"LEGACY_REQUIRED"}]),function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"}(G_||(G_={})),N_.util.setEnumType(G_,"google.protobuf.FeatureSet.EnumType",[{no:0,name:"ENUM_TYPE_UNKNOWN"},{no:1,name:"OPEN"},{no:2,name:"CLOSED"}]),function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"}(q_||(q_={})),N_.util.setEnumType(q_,"google.protobuf.FeatureSet.RepeatedFieldEncoding",[{no:0,name:"REPEATED_FIELD_ENCODING_UNKNOWN"},{no:1,name:"PACKED"},{no:2,name:"EXPANDED"}]),function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"}(W_||(W_={})),N_.util.setEnumType(W_,"google.protobuf.FeatureSet.Utf8Validation",[{no:0,name:"UTF8_VALIDATION_UNKNOWN"},{no:2,name:"VERIFY"},{no:3,name:"NONE"}]),function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"}(z_||(z_={})),N_.util.setEnumType(z_,"google.protobuf.FeatureSet.MessageEncoding",[{no:0,name:"MESSAGE_ENCODING_UNKNOWN"},{no:1,name:"LENGTH_PREFIXED"},{no:2,name:"DELIMITED"}]),function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"}(V_||(V_={})),N_.util.setEnumType(V_,"google.protobuf.FeatureSet.JsonFormat",[{no:0,name:"JSON_FORMAT_UNKNOWN"},{no:1,name:"ALLOW"},{no:2,name:"LEGACY_BEST_EFFORT"}]);class bg extends Ah{constructor(e){super(),this.defaults=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new bg).fromBinary(e,t)}static fromJson(e,t){return(new bg).fromJson(e,t)}static fromJsonString(e,t){return(new bg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(bg,e,t)}}bg.runtime=N_,bg.typeName="google.protobuf.FeatureSetDefaults",bg.fields=N_.util.newFieldList((()=>[{no:1,name:"defaults",kind:"message",T:wg,repeated:!0},{no:4,name:"minimum_edition",kind:"enum",T:N_.getEnumType(A_),opt:!0},{no:5,name:"maximum_edition",kind:"enum",T:N_.getEnumType(A_),opt:!0}]));class wg extends Ah{constructor(e){super(),N_.util.initPartial(e,this)}static fromBinary(e,t){return(new wg).fromBinary(e,t)}static fromJson(e,t){return(new wg).fromJson(e,t)}static fromJsonString(e,t){return(new wg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(wg,e,t)}}wg.runtime=N_,wg.typeName="google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",wg.fields=N_.util.newFieldList((()=>[{no:3,name:"edition",kind:"enum",T:N_.getEnumType(A_),opt:!0},{no:4,name:"overridable_features",kind:"message",T:yg,opt:!0},{no:5,name:"fixed_features",kind:"message",T:yg,opt:!0}]));class kg extends Ah{constructor(e){super(),this.location=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new kg).fromBinary(e,t)}static fromJson(e,t){return(new kg).fromJson(e,t)}static fromJsonString(e,t){return(new kg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(kg,e,t)}}kg.runtime=N_,kg.typeName="google.protobuf.SourceCodeInfo",kg.fields=N_.util.newFieldList((()=>[{no:1,name:"location",kind:"message",T:Eg,repeated:!0}]));class Eg extends Ah{constructor(e){super(),this.path=[],this.span=[],this.leadingDetachedComments=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new Eg).fromBinary(e,t)}static fromJson(e,t){return(new Eg).fromJson(e,t)}static fromJsonString(e,t){return(new Eg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(Eg,e,t)}}Eg.runtime=N_,Eg.typeName="google.protobuf.SourceCodeInfo.Location",Eg.fields=N_.util.newFieldList((()=>[{no:1,name:"path",kind:"scalar",T:5,repeated:!0,packed:!0},{no:2,name:"span",kind:"scalar",T:5,repeated:!0,packed:!0},{no:3,name:"leading_comments",kind:"scalar",T:9,opt:!0},{no:4,name:"trailing_comments",kind:"scalar",T:9,opt:!0},{no:6,name:"leading_detached_comments",kind:"scalar",T:9,repeated:!0}]));class Sg extends Ah{constructor(e){super(),this.annotation=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new Sg).fromBinary(e,t)}static fromJson(e,t){return(new Sg).fromJson(e,t)}static fromJsonString(e,t){return(new Sg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(Sg,e,t)}}Sg.runtime=N_,Sg.typeName="google.protobuf.GeneratedCodeInfo",Sg.fields=N_.util.newFieldList((()=>[{no:1,name:"annotation",kind:"message",T:Tg,repeated:!0}]));class Tg extends Ah{constructor(e){super(),this.path=[],N_.util.initPartial(e,this)}static fromBinary(e,t){return(new Tg).fromBinary(e,t)}static fromJson(e,t){return(new Tg).fromJson(e,t)}static fromJsonString(e,t){return(new Tg).fromJsonString(e,t)}static equals(e,t){return N_.util.equals(Tg,e,t)}}Tg.runtime=N_,Tg.typeName="google.protobuf.GeneratedCodeInfo.Annotation",Tg.fields=N_.util.newFieldList((()=>[{no:1,name:"path",kind:"scalar",T:5,repeated:!0,packed:!0},{no:2,name:"source_file",kind:"scalar",T:9,opt:!0},{no:3,name:"begin",kind:"scalar",T:5,opt:!0},{no:4,name:"end",kind:"scalar",T:5,opt:!0},{no:5,name:"semantic",kind:"enum",T:N_.getEnumType(J_),opt:!0}])),function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"}(J_||(J_={})),N_.util.setEnumType(J_,"google.protobuf.GeneratedCodeInfo.Annotation.Semantic",[{no:0,name:"NONE"},{no:1,name:"SET"},{no:2,name:"ALIAS"}]);const Ig=l_.makeEnum("expr.ContentType",[{no:0,name:"Unknown"},{no:2001,name:"SamanthaText"},{no:2002,name:"SamanthaSuggest"},{no:2003,name:"SamanthaLoading"},{no:2004,name:"SamanthaMusic"},{no:2005,name:"SamanthaMusicGenInput"},{no:2006,name:"SamanthaMusicGenOutput"},{no:2007,name:"SamanthaSearchCard"},{no:2008,name:"SamanthaSearchText"},{no:2009,name:"SamanthaImageInput"},{no:2010,name:"SamanthaImageOutput"},{no:2011,name:"SamanthaTranslate"},{no:2012,name:"SamanthaReadInput"},{no:2013,name:"SamanthaWebpageInput"},{no:2014,name:"SamanthaSearchInput"}]),xg=l_.makeEnum("expr.AliceContentType",[{no:0,name:"AliceUnknown"},{no:1,name:"AliceText"},{no:2,name:"AliceSuggest"},{no:3,name:"AliceMusic"},{no:4,name:"AliceWebView"},{no:5,name:"AliceVideo"},{no:6,name:"AliceImage"},{no:7,name:"AliceFile"},{no:8,name:"AlicePluginSearchResult"},{no:9,name:"AliceAwemeVideoList"},{no:10,name:"AliceComposite"},{no:11,name:"AliceBiz"},{no:20,name:"AliceNested"},{no:50,name:"AliceCard"},{no:51,name:"AliceBotCard"},{no:53,name:"AliceFormMsg"},{no:60,name:"AliceCopilotCard"},{no:70,name:"AliceLyricsToSongMusic"},{no:71,name:"AliceLyricsToSongLyric"},{no:72,name:"AliceLyricsToSongsMusic"},{no:80,name:"AlicePagesCard"},{no:81,name:"AliceOutline"},{no:100,name:"AliceWidget"},{no:1e3,name:"AliceUnsupported"}]),Og=l_.makeEnum("expr.SkillType",[{no:0,name:"SkillFreeChat"},{no:2,name:"SkillWrite"},{no:3,name:"SkillImageGen"},{no:4,name:"SkillSearch"},{no:5,name:"SkillTranslate"},{no:6,name:"SkillRead"},{no:7,name:"SkillWebpage"},{no:8,name:"SkillDeepSearch"},{no:9,name:"SkillMusicGen"}]),Ng=l_.makeMessageType("expr.Option",(()=>[{no:1,name:"content_type",kind:"enum",T:l_.getEnumType(Ig)},{no:2,name:"need_store",kind:"scalar",T:8},{no:3,name:"alice_content_type",kind:"enum",T:l_.getEnumType(xg)},{no:4,name:"skill_type",kind:"enum",T:l_.getEnumType(Og)}]));l_.makeExtension("expr.doubao_content",cg,(()=>({no:5e4,kind:"message",T:Ng})));const Ag=e=>t=>e.includes(t);Ag(["txt"]),Ag(["csv"]),Ag(["xlsx","xls"]),Ag(["xbm","tif","pjp","svgz","jpg","jpeg","ico","tiff","gif","svg","jfif","webp","png","bmp","pjpeg","avif"]),Ag(["pdf"]),Ag(["ppt","pptx"]),Ag(["doc","docx"]),Ag(["md","markdown"]),Ag(["epub"]),Ag(["mobi"]);Th.Unknown,Th.File,Th.Image,Th.Text,Th.File,Th.Link,Th.Image;let Rg=function(e){return e[e.Default=0]="Default",e[e.ReadAndSummarize=1]="ReadAndSummarize",e[e.WriteAssistant=2]="WriteAssistant",e[e.ImageGeneration=3]="ImageGeneration",e[e.Search=4]="Search",e[e.Translate=5]="Translate",e[e.ReadPDF=6]="ReadPDF",e[e.ReadWebsite=7]="ReadWebsite",e[e.DeepSearch=8]="DeepSearch",e[e.MusicAssistant=9]="MusicAssistant",e[e.AcademicSearch=10]="AcademicSearch",e[e.ExerciseAssistant=11]="ExerciseAssistant",e[e.ReadMultiWebsites=12]="ReadMultiWebsites",e[e.CodeInterpreter=13]="CodeInterpreter",e}({});Rg.Default,Ig.SamanthaText,Rg.ImageGeneration,Ig.SamanthaImageInput,Rg.MusicAssistant,Ig.SamanthaMusicGenInput,Rg.AcademicSearch,Ig.SamanthaText,Rg.Search,Ig.SamanthaSearchInput,Rg.DeepSearch,Ig.SamanthaText,Rg.Translate,Ig.SamanthaTranslate,Rg.WriteAssistant,Ig.SamanthaText,Rg.ReadPDF,Ig.SamanthaReadInput,Rg.ReadWebsite,Ig.SamanthaWebpageInput,Rg.ExerciseAssistant,Ig.SamanthaText,Rg.ReadAndSummarize,Ig.SamanthaText,Rg.ReadMultiWebsites,Ig.SamanthaText,Rg.CodeInterpreter,Ig.SamanthaText;n(50474);var Lg=Object.prototype.hasOwnProperty;ds((function(e,t){if(G(t)||Le(t))os(t,In(t),e);else for(var n in t)Lg.call(t,n)&&yr(e,n,t[n])}));function Cg(){return(Cg=o((function*(e,t){const n=e.getReader();let r;for(;!(r=yield n.read()).done;)t(r.value)}))).apply(this,arguments)}function Pg(e){let t,n,r,i=!1;return function(o){void 0===t?(t=o,n=0,r=-1):t=function(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(t,o);const s=t.length;let a=0;for(;n<s;){i&&(10===t[n]&&(a=++n),i=!1);let o=-1;for(;n<s&&-1===o;++n)switch(t[n]){case 58:-1===r&&(r=n-a);break;case 13:i=!0;case 10:o=n}if(-1===o)break;e(t.subarray(a,o),r),a=n,r=-1}a===s?t=void 0:0!==a&&(t=t.subarray(a),n-=a)}}const Mg=["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"],Dg="text/event-stream",jg=1e3,Bg="last-event-id";function Fg(e,t){let{signal:n,headers:r,onopen:i,onmessage:s,onclose:a,onerror:c,openWhenHidden:u,fetch:d}=t,f=B(t,Mg);return new Promise(((t,p)=>{const h=l({},r);let m;function _(){m.abort(),document.hidden||k()}h.accept||(h.accept=Dg),"undefined"==typeof document||u||document.addEventListener("visibilitychange",_);let g=jg,v=0;function y(){"undefined"==typeof document||u||document.removeEventListener("visibilitychange",_),clearTimeout(v),m.abort()}null==n||n.addEventListener("abort",(()=>{y(),t()}));const b=null!=d?d:fetch,w=null!=i?i:Ug;function k(){return E.apply(this,arguments)}function E(){return E=o((function*(){m=new AbortController;try{const n=yield b(e,l(l({},f),{},{headers:h,signal:m.signal}));yield w(n),yield function(e,t){return Cg.apply(this,arguments)}(n.body,Pg(function(e,t,n){let r={data:"",event:"",id:"",retry:void 0};const i=new TextDecoder;return function(o,s){if(0===o.length)null==n||n(r),r={data:"",event:"",id:"",retry:void 0};else if(s>0){const n=i.decode(o.subarray(0,s)),a=s+(32===o[s+1]?2:1),c=i.decode(o.subarray(a));switch(n){case"data":r.data=r.data?`${r.data}\n${c}`:c;break;case"event":r.event=c;break;case"id":e(r.id=c);break;case"retry":const n=parseInt(c,10);isNaN(n)||t(r.retry=n)}}}}((e=>{e?h[Bg]=e:delete h[Bg]}),(e=>{g=e}),s))),null==a||a(),y(),t()}catch(r){if(!m.signal.aborted)try{var n;const e=null!==(n=null==c?void 0:c(r))&&void 0!==n?n:g;clearTimeout(v),v=setTimeout(k,e)}catch(i){y(),p(i)}}})),E.apply(this,arguments)}k()}))}function Ug(e){const t=e.headers.get("content-type");if(null==t||!t.startsWith(Dg))throw new Error(`Expected content-type to be ${Dg}, Actual: ${t}`)}const Gg={};function qg(e){return delete Gg[e]}function Wg(e,t){var n;null===(n=function(e){return Gg[e]}(e))||void 0===n||n.abort(t),qg(e)}function zg(e){const{id:t,url:n,req:r={},timeout:i=6e4,onOpen:s,onUpdate:a,onFinish:c,onError:u,onAbort:d,onClose:f}=e;let p,h="",m=!1,_=!1,g="";const v=()=>{_||(null==c||c({id:t,event:"done",code:"ok",message:h,body:p,logId:g}),_=!0,qg(t))},y=e=>{p=e.body,null==a||a(l({logId:g},e))},b=e=>{m||null==u||u(l({logId:g},e)),m=!0},w=new AbortController;w.signal.onabort=e=>{lo("[zoei] request aborted",t,e.currentTarget),null==d||d({id:t,event:"abort"})},function(e,t){Gg[e]=t}(t,w);const k=setTimeout((()=>w.abort("timeout")),i),E=l(l({method:"POST"},r),{},{headers:l({"Content-Type":"application/json"},null==r?void 0:r.headers),signal:w.signal});lo("[zoei] stream fetch",t,E);try{Fg(n,l(l({},E),{},{onopen:e=>o((function*(){var n;clearTimeout(k);const r=e.headers.get("content-type");let i={};g=null!==(n=e.headers.get("x-tt-logid"))&&void 0!==n?n:g;try{null!=r&&r.startsWith("application/json")&&(i=yield e.clone().json())}catch(o){oc.persist.error({message:"Parse json error",error:o})}try{null!=r&&r.startsWith("text/plain")&&(h=yield e.clone().text())}catch(o){oc.persist.error({message:"Parse json error",error:o})}lo("[zoei] stream fetch onopen",e.status,r,i),null==s||s({id:t,event:"open",status:e.status,jsonData:i,logId:g}),e.ok&&null!=r&&r.startsWith(Dg)&&200===e.status||b({id:t,event:"error",status:e.status,code:"fail",message:h,jsonData:i,logId:g})}))(),onmessage(e){const{event:n,data:r}=e;if(lo("[zoei] stream fetch onmessage",n,r),_)return v();switch(n){case"done":return v();case"json":try{return null==y?void 0:y({id:t,event:"data",body:JSON.parse(r)})}catch(i){return null==y?void 0:y({id:t,event:"data",code:"parse_json_error"})}case"pb":return null==y?void 0:y({id:t,event:"data",body:O_(r)});case"err":return b({id:t,event:"error",code:"fail",message:r,body:p,logId:g});default:return}},onclose(){lo("[zoei] stream fetch onclose"),qg(t),null==f||f({id:t,event:"close",logId:g})},onerror(e){throw lo("[zoei] stream fetch onerror",e),b({id:t,event:"error",code:`${e}`,message:"Server Error",body:p,logId:g}),qg(t),e},openWhenHidden:!0}))}catch(b){throw oc.persist.error({message:"Parse json error",error:b}),b}return{abort:e=>w.abort(e)}}const Vg=(e,t)=>{Dd({type:"fetch-stream",payload:t,action:e})},Jg=(e,t)=>{if(lo("[zoei] im sdk sse handler",e.body),!e.body)return;const{id:n,type:r,payload:i,reason:o}=e.body;if("abort"===r)return void Wg(n,o);const{req:{url:s,body:a}}=i,c=Cd();Zd.sendEvent(l({name:"request_start"},j({url:s,localRequestId:n,isSse:!0,"x-tt-env":null==c?void 0:c["x-tt-env"]}))),Vg("start",e),zg({id:n,url:jd(s,Ld()),req:{headers:c,body:JSON.stringify(a)},onOpen(e){var r;const{jsonData:i,logId:o,status:a=200}=e,u=Number(null!==(r=null==i?void 0:i.code)&&void 0!==r?r:0);0!==u&&Zd.sendEvent(l({name:"response_server_code_invalid"},j({url:s,msg:(null==i?void 0:i.msg)||"",code:`${u}`,statusCode:a,logId:o,localRequestId:n,isSse:!0,"x-tt-env":null==c?void 0:c["x-tt-env"]}))),[Pd.NOACCESS,Pd.NOT_LOGIN].includes(u)&&nf.emit("auth-info-request-updated"),t.send(e),Vg("open",e)},onFinish(e){t.send(e),Vg("finish",e)},onUpdate(e){t.send(e),Vg("update",e)},onError(e){const{code:r,message:i="",logId:o,status:a=200}=e;Zd.sendEvent(l({name:"response_server_error"},j({url:s,message:i,code:`${r}`,statusCode:a,logId:o,localRequestId:n,isSse:!0,"x-tt-env":null==c?void 0:c["x-tt-env"]}))),t.send(e),Vg("error",e)},onAbort(e){t.send(e),Vg("abort",e)},onClose(e){t.send(e),Vg("close",e)}})},Hg={"im-sdk-socket":wh,"fetch-stream":Jg,"file-reader":Sh,websocket:Qp},Kg=()=>{nf.addListener("auth-login",_h),nf.addListener("auth-logout",gh),nf.addListener("ttwid-changed-un-authorized",_h);var e;(()=>{if(!vo)throw new Error("Extension runtime is not available");return vo})().onConnect.addListener((e=>{const t=Hg[e.name];t&&ph(e,t)})),Md.forEach((e=>null==e?void 0:e.disconnect())),null===(e=chrome)||void 0===e||null===(e=e.runtime)||void 0===e||null===(e=e.onConnect)||void 0===e||e.addListener((e=>{if("log-event-debug"===e.name){if(Md.length>=3){const e=Md.shift();null==e||e.disconnect()}lo("[lwx] add log port"),e.onDisconnect.addListener((()=>{Md=Md.filter((t=>t!==e))})),Md.push(e)}}))};const $g=3e5;function Yg(){return Xg.apply(this,arguments)}function Xg(){return(Xg=o((function*(){const e=Va("featureInfo")||{},t=wo();if(e.version=t,(null==e?void 0:e.dotVisibleVersion)===t&&(null==e?void 0:e.cardVisibleVersion)===t)throw new Error("changelog already read");if(e.data&&e.data.version===t&&e.dataLastUpdate&&Date.now()-e.dataLastUpdate<$g)return e;const n=yield sf({url:`${Ps}/plugin/change_log`,method:"GET",params:{version:t}});if((null==n?void 0:n.length)>0){const r=n[0]||{};e.dataLastUpdate=Date.now(),e.data={version:t,title:r.title,description:r.description,linkUrl:r.detail_url,coverImageUrl:r.picture_url}}else e.dataLastUpdate=Date.now(),e.data=void 0;return e}))).apply(this,arguments)}const Qg={name:"get-new-feature",handle:function(){var e=o((function*(){try{const e=yield Yg();return za("featureInfo",e),{code:0,data:e}}catch(e){return fo(e),{code:1,msg:e.message}}}));return function(){return e.apply(this,arguments)}}()},Zg=()=>{ks.watch({uiLanguage:function(){var e=o((function*(e){za("uiLanguage",e.newValue);const{language_list:t}=yield Cf();Ya({languageList:t},!0),function(){const e=Va("featureInfo");e&&(e.data=void 0,e.dataLastUpdate=0,za("featureInfo",e)),Yg().then((e=>{za("featureInfo",e)}))}()}));return function(t){return e.apply(this,arguments)}}()})},ev=JSON.parse('{"zh":{"web":{"flow_web_ext_action_ask":"AI \u641c\u7d22","flow_web_ext_action_explain":"\u89e3\u91ca","flow_web_ext_action_translate":"\u7ffb\u8bd1","flow_web_ext_action_grammar":"\u4fee\u6b63\u8bed\u6cd5","flow_web_ext_action_rewrite":"\u5199\u6b63\u5f0f\u70b9","flow_web_ext_contextmenu_web_bookmarks":"\u6536\u85cf\u7f51\u9875\u5230{brandName}","flow_web_ext_action_bookmarks":"\u6536\u85cf","message_long_press_copy":"\u590d\u5236","cici_desktop_skill_make_longer":"\u6269\u5199","cici_desktop_skill_make_shorter":"\u7f29\u5199","cici_desktop_skill_write_formally":"\u5199\u6b63\u5f0f\u70b9","cici_desktop_skill_grammar_correction":"\u8bed\u6cd5\u4fee\u6b63","cici_desktop_skill_writing_improvement":"\u5199\u4f5c\u6539\u8fdb","cici_desktop_skill_link_summary":"\u94fe\u63a5\u603b\u7ed3","cici_desktop_skill_write_instagram":"\u6539\u5199 Instagram","cici_desktop_skill_write_twitter":"\u6539\u5199 Twitter","cici_desktop_skill_tiktok_script":"\u6539\u5199 TikTok \u811a\u672c","cici_desktop_skill_generate_weekly_report":"\u751f\u6210\u5468\u62a5","cici_desktop_skill_generate_OKR":"\u751f\u6210 OKR","cici_desktop_skill_explain_code":"\u9010\u884c\u89e3\u91ca\u4ee3\u7801","cici_desktop_skill_find_bugs":"\u4ee3\u7801\u7ea0\u9519","cici_desktop_skill_interpret_code_errors":"\u89e3\u8bfb\u4ee3\u7801\u62a5\u9519","cici_desktop_skill_brainstorm":"\u5934\u8111\u98ce\u66b4","cici_desktop_skill_extract_todos":"\u62bd\u53d6\u4efb\u52a1\u9879","cici_desktop_skill_pros_Cons":"\u603b\u7ed3\u4f18\u7f3a\u70b9","cici_desktop_skill_extract_keywords":"\u63d0\u70bc\u5173\u952e\u8bcd","cici_desktop_skill_optimization_prompt":"\u4f18\u5316\u63d0\u793a\u8bcd","cici_desktop_skill_improve_search_keywords":"\u4f18\u5316\u641c\u7d22\u8bcd","flow_web_ext_contextmenu_summarize":"\u603b\u7ed3\u7f51\u9875","flow_web_ext_contextmenu_translate":"\u7ffb\u8bd1\u7f51\u9875","flow_web_ext_contextmenu_bookmark":"\u6536\u85cf\u7f51\u9875","modify_change_tone":"\u8c03\u6574\u8bed\u6c14"}},"zh-Hant":{"web":{"flow_web_ext_action_ask":"AI \u641c\u5c0b","flow_web_ext_action_explain":"\u8aaa\u660e","flow_web_ext_action_translate":"\u7ffb\u8b6f","flow_web_ext_action_grammar":"\u66f4\u6b63\u6587\u6cd5","flow_web_ext_action_rewrite":"\u91cd\u65b0\u7de8\u5beb","flow_web_ext_contextmenu_web_bookmarks":"\u65b0\u589e\u7db2\u9801\u66f8\u7c64\u5230 {brandName}","flow_web_ext_action_bookmarks":"\u66f8\u7c64","message_long_press_copy":"\u8907\u88fd","cici_desktop_skill_make_longer":"\u8acb\u64f4\u5beb","cici_desktop_skill_make_shorter":"\u8acb\u7cbe\u7c21","cici_desktop_skill_write_formally":"\u4ee5\u6b63\u5f0f\u8a9e\u6c23\u64b0\u5beb","cici_desktop_skill_grammar_correction":"\u6587\u6cd5\u66f4\u6b63","cici_desktop_skill_writing_improvement":"\u5beb\u4f5c\u512a\u5316","cici_desktop_skill_link_summary":"\u9023\u7d50\u6458\u8981","cici_desktop_skill_write_instagram":"\u64b0\u5beb Instagram \u63a8\u6587","cici_desktop_skill_write_twitter":"\u64b0\u5beb Twitter \u63a8\u6587","cici_desktop_skill_tiktok_script":"TikTok \u8173\u672c","cici_desktop_skill_generate_weekly_report":"\u7522\u751f\u9031\u5831","cici_desktop_skill_generate_OKR":"\u7522\u751f OKR","cici_desktop_skill_explain_code":"\u89e3\u91cb\u4ee3\u78bc","cici_desktop_skill_find_bugs":"\u5c0b\u627e\u932f\u8aa4","cici_desktop_skill_interpret_code_errors":"\u89e3\u8b80\u4ee3\u78bc\u932f\u8aa4","cici_desktop_skill_brainstorm":"\u8166\u529b\u6fc0\u76ea","cici_desktop_skill_extract_todos":"\u64f7\u53d6\u5f85\u8fa6\u4e8b\u9805","cici_desktop_skill_pros_Cons":"\u512a\u7f3a\u9ede","cici_desktop_skill_extract_keywords":"\u64f7\u53d6\u95dc\u9375\u5b57","cici_desktop_skill_optimization_prompt":"\u512a\u5316\u63d0\u793a","cici_desktop_skill_improve_search_keywords":"\u6539\u5584\u641c\u5c0b\u95dc\u9375\u5b57","flow_web_ext_contextmenu_summarize":"\u6458\u8981\u7db2\u9801","flow_web_ext_contextmenu_translate":"\u7ffb\u8b6f\u7db2\u9801","flow_web_ext_contextmenu_bookmark":"\u5c07\u7db2\u9801\u52a0\u5165\u66f8\u7c64","modify_change_tone":"\u8b8a\u66f4\u8a9e\u6c23"}},"vi":{"web":{"flow_web_ext_action_ask":"AI Search","flow_web_ext_action_explain":"Gi\u1ea3i th\xedch","flow_web_ext_action_translate":"D\u1ecbch","flow_web_ext_action_grammar":"S\u1eeda ng\u1eef ph\xe1p","flow_web_ext_action_rewrite":"Vi\u1ebft l\u1ea1i","flow_web_ext_contextmenu_web_bookmarks":"\u0110\xe1nh d\u1ea5u trang web v\xe0o {brandName}","flow_web_ext_action_bookmarks":"\u0110\xe1nh d\u1ea5u","message_long_press_copy":"Sao ch\xe9p","cici_desktop_skill_make_longer":"Vi\u1ebft d\xe0i h\u01a1n","cici_desktop_skill_make_shorter":"Vi\u1ebft ng\u1eafn l\u1ea1i","cici_desktop_skill_write_formally":"Vi\u1ebft trang tr\u1ecdng","cici_desktop_skill_grammar_correction":"S\u1eeda l\u1ed7i ng\u1eef ph\xe1p","cici_desktop_skill_writing_improvement":"C\u1ea3i thi\u1ec7n v\u0103n phong","cici_desktop_skill_link_summary":"T\xf3m t\u1eaft li\xean k\u1ebft","cici_desktop_skill_write_instagram":"Vi\u1ebft b\xe0i \u0111\u0103ng tr\xean Instagram","cici_desktop_skill_write_twitter":"Vi\u1ebft b\xe0i \u0111\u0103ng tr\xean Twitter","cici_desktop_skill_tiktok_script":"K\u1ecbch b\u1ea3n TikTok","cici_desktop_skill_generate_weekly_report":"T\u1ea1o b\xe1o c\xe1o h\u1eb1ng tu\u1ea7n","cici_desktop_skill_generate_OKR":"T\u1ea1o OKR","cici_desktop_skill_explain_code":"Gi\u1ea3i th\xedch m\xe3","cici_desktop_skill_find_bugs":"T\xecm l\u1ed7i","cici_desktop_skill_interpret_code_errors":"Di\u1ec5n gi\u1ea3i m\xe3 l\u1ed7i","cici_desktop_skill_brainstorm":"\u0110\u1ed9ng n\xe3o","cici_desktop_skill_extract_todos":"Tr\xedch xu\u1ea5t vi\u1ec7c c\u1ea7n l\xe0m","cici_desktop_skill_pros_Cons":"\u01afu \u0111i\u1ec3m v\xe0 nh\u01b0\u1ee3c \u0111i\u1ec3m","cici_desktop_skill_extract_keywords":"Tr\xedch xu\u1ea5t t\u1eeb kh\xf3a","cici_desktop_skill_optimization_prompt":"G\u1ee3i \xfd t\u1ed1i \u01b0u h\xf3a","cici_desktop_skill_improve_search_keywords":"C\u1ea3i thi\u1ec7n t\u1eeb kh\xf3a t\xecm ki\u1ebfm","flow_web_ext_contextmenu_summarize":"T\xf3m t\u1eaft trang web","flow_web_ext_contextmenu_translate":"D\u1ecbch trang web","flow_web_ext_contextmenu_bookmark":"L\u01b0u d\u1ea5u trang web","modify_change_tone":"Thay \u0111\u1ed5i gi\u1ecdng \u0111i\u1ec7u"}},"uz":{"web":{"flow_web_ext_action_ask":"SI qidiruv","flow_web_ext_action_explain":"Izohlash","flow_web_ext_action_translate":"Tarjima qilish","flow_web_ext_action_grammar":"Grammatik tuzatish","flow_web_ext_action_rewrite":"Qayta yozish","flow_web_ext_contextmenu_web_bookmarks":"Veb sahifani bukmark {brandName}","flow_web_ext_action_bookmarks":"Xatcho\u02bbp","message_long_press_copy":"Nusxa olish","cici_desktop_skill_make_longer":"Uzunroq qilish","cici_desktop_skill_make_shorter":"Qisqaroq qilish","cici_desktop_skill_write_formally":"Rasmiy yozish","cici_desktop_skill_grammar_correction":"Grammatik tuzatish","cici_desktop_skill_writing_improvement":"Yozuvni takomillashtirish","cici_desktop_skill_link_summary":"Havola xulosasi","cici_desktop_skill_write_instagram":"Instagram yozish","cici_desktop_skill_write_twitter":"Twitter yozish","cici_desktop_skill_tiktok_script":"TikTok skripti","cici_desktop_skill_generate_weekly_report":"Haftalik hisobot yaratish","cici_desktop_skill_generate_OKR":"OKR yaratish","cici_desktop_skill_explain_code":"Kodni izohlash","cici_desktop_skill_find_bugs":"Xatoliklarni topish","cici_desktop_skill_interpret_code_errors":"Kod xatolarini talqin qilish","cici_desktop_skill_brainstorm":"Aqliy hujum","cici_desktop_skill_extract_todos":"Vazifalarni olish","cici_desktop_skill_pros_Cons":"Yaxshi va yomon tomonlari","cici_desktop_skill_extract_keywords":"Kalit so\u02bbzlarni ajratish","cici_desktop_skill_optimization_prompt":"Optimallash taklifi","cici_desktop_skill_improve_search_keywords":"Qidiruv kalit so\u02bbzlarini yaxshilash","flow_web_ext_contextmenu_summarize":"Veb sahifani xulosalash","flow_web_ext_contextmenu_translate":"Veb sahifani tarjima qilish","flow_web_ext_contextmenu_bookmark":"Veb sahifani bukmarklash","modify_change_tone":"Ohangni o\u02bbzgartirish"}},"th-TH":{"web":{"flow_web_ext_action_ask":"\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e14\u0e49\u0e27\u0e22 AI","flow_web_ext_action_explain":"\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22","flow_web_ext_action_translate":"\u0e41\u0e1b\u0e25","flow_web_ext_action_grammar":"\u0e41\u0e01\u0e49\u0e44\u0e02\u0e44\u0e27\u0e22\u0e32\u0e01\u0e23\u0e13\u0e4c","flow_web_ext_action_rewrite":"\u0e40\u0e02\u0e35\u0e22\u0e19\u0e43\u0e2b\u0e21\u0e48","flow_web_ext_contextmenu_web_bookmarks":"\u0e1a\u0e38\u0e4a\u0e04\u0e21\u0e32\u0e23\u0e4c\u0e01\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e1b\u0e17\u0e35\u0e48 {brandName}","flow_web_ext_action_bookmarks":"\u0e1a\u0e38\u0e4a\u0e01\u0e21\u0e32\u0e23\u0e4c\u0e01","message_long_press_copy":"\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01","cici_desktop_skill_make_longer":"\u0e17\u0e33\u0e43\u0e2b\u0e49\u0e22\u0e32\u0e27\u0e02\u0e36\u0e49\u0e19","cici_desktop_skill_make_shorter":"\u0e17\u0e33\u0e43\u0e2b\u0e49\u0e2a\u0e31\u0e49\u0e19\u0e25\u0e07","cici_desktop_skill_write_formally":"\u0e40\u0e02\u0e35\u0e22\u0e19\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e17\u0e32\u0e07\u0e01\u0e32\u0e23","cici_desktop_skill_grammar_correction":"\u0e01\u0e32\u0e23\u0e41\u0e01\u0e49\u0e44\u0e02\u0e44\u0e27\u0e22\u0e32\u0e01\u0e23\u0e13\u0e4c","cici_desktop_skill_writing_improvement":"\u0e01\u0e32\u0e23\u0e1b\u0e23\u0e31\u0e1a\u0e1b\u0e23\u0e38\u0e07\u0e01\u0e32\u0e23\u0e40\u0e02\u0e35\u0e22\u0e19","cici_desktop_skill_link_summary":"\u0e2a\u0e23\u0e38\u0e1b\u0e25\u0e34\u0e07\u0e01\u0e4c","cici_desktop_skill_write_instagram":"\u0e40\u0e02\u0e35\u0e22\u0e19 Instagram","cici_desktop_skill_write_twitter":"\u0e40\u0e02\u0e35\u0e22\u0e19 Twitter","cici_desktop_skill_tiktok_script":"\u0e2a\u0e04\u0e23\u0e34\u0e1b\u0e15\u0e4c TikTok","cici_desktop_skill_generate_weekly_report":"\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e23\u0e32\u0e22\u0e2a\u0e31\u0e1b\u0e14\u0e32\u0e2b\u0e4c","cici_desktop_skill_generate_OKR":"\u0e2a\u0e23\u0e49\u0e32\u0e07 OKR","cici_desktop_skill_explain_code":"\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e23\u0e2b\u0e31\u0e2a","cici_desktop_skill_find_bugs":"\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14","cici_desktop_skill_interpret_code_errors":"\u0e41\u0e1b\u0e25\u0e23\u0e2b\u0e31\u0e2a\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14","cici_desktop_skill_brainstorm":"\u0e23\u0e30\u0e14\u0e21\u0e04\u0e27\u0e32\u0e21\u0e04\u0e34\u0e14","cici_desktop_skill_extract_todos":"\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e2a\u0e34\u0e48\u0e07\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e17\u0e33","cici_desktop_skill_pros_Cons":"\u0e02\u0e49\u0e2d\u0e14\u0e35\u0e41\u0e25\u0e30\u0e02\u0e49\u0e2d\u0e40\u0e2a\u0e35\u0e22","cici_desktop_skill_extract_keywords":"\u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e04\u0e33\u0e2b\u0e25\u0e31\u0e01","cici_desktop_skill_optimization_prompt":"\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21\u0e41\u0e08\u0e49\u0e07\u0e01\u0e32\u0e23\u0e1b\u0e23\u0e31\u0e1a\u0e1b\u0e23\u0e38\u0e07","cici_desktop_skill_improve_search_keywords":"\u0e1b\u0e23\u0e31\u0e1a\u0e1b\u0e23\u0e38\u0e07\u0e04\u0e33\u0e04\u0e49\u0e19\u0e2b\u0e32","flow_web_ext_contextmenu_summarize":"\u0e2a\u0e23\u0e38\u0e1b\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e27\u0e47\u0e1a","flow_web_ext_contextmenu_translate":"\u0e41\u0e1b\u0e25\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e27\u0e47\u0e1a","flow_web_ext_contextmenu_bookmark":"\u0e1a\u0e38\u0e4a\u0e01\u0e21\u0e32\u0e23\u0e4c\u0e01\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e27\u0e47\u0e1a","modify_change_tone":"\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e19\u0e49\u0e33\u0e40\u0e2a\u0e35\u0e22\u0e07"}},"ru":{"web":{"flow_web_ext_action_ask":"\u0418\u0418-\u043f\u043e\u0438\u0441\u043a","flow_web_ext_action_explain":"\u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c","flow_web_ext_action_translate":"\u041f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438","flow_web_ext_action_grammar":"\u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0443","flow_web_ext_action_rewrite":"\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043d\u043e\u0432\u0430","flow_web_ext_contextmenu_web_bookmarks":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u0434\u043b\u044f {brandName}","flow_web_ext_action_bookmarks":"\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0443","message_long_press_copy":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c","cici_desktop_skill_make_longer":"\u0423\u0434\u043b\u0438\u043d\u0438\u0442\u044c","cici_desktop_skill_make_shorter":"\u0421\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c","cici_desktop_skill_write_formally":"\u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c","cici_desktop_skill_grammar_correction":"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0438","cici_desktop_skill_writing_improvement":"\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u044f","cici_desktop_skill_link_summary":"\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u0432\u043e\u0434\u043a\u0443","cici_desktop_skill_write_instagram":"\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u043b\u044f Instagram","cici_desktop_skill_write_twitter":"\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0434\u043b\u044f Twitter","cici_desktop_skill_tiktok_script":"\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0432\u0438\u0434\u0435\u043e TikTok","cici_desktop_skill_generate_weekly_report":"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0436\u0435\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0447\u0435\u0442","cici_desktop_skill_generate_OKR":"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0446\u0435\u043b\u0438 \u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b","cici_desktop_skill_explain_code":"\u041e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043a\u043e\u0434","cici_desktop_skill_find_bugs":"\u041d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0438","cici_desktop_skill_interpret_code_errors":"\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u043a\u043e\u0434\u0430","cici_desktop_skill_brainstorm":"\u041c\u043e\u0437\u0433\u043e\u0432\u043e\u0439 \u0448\u0442\u0443\u0440\u043c","cici_desktop_skill_extract_todos":"\u0418\u0437\u0432\u043b\u0435\u0447\u044c \u0437\u0430\u0434\u0430\u0447\u0438","cici_desktop_skill_pros_Cons":"\u041f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b","cici_desktop_skill_extract_keywords":"\u0418\u0437\u0432\u043b\u0435\u0447\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430","cici_desktop_skill_optimization_prompt":"\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u043f\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438","cici_desktop_skill_improve_search_keywords":"\u0423\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430","flow_web_ext_contextmenu_summarize":"\u0420\u0435\u0437\u044e\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443","flow_web_ext_contextmenu_translate":"\u041f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443","flow_web_ext_contextmenu_bookmark":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438","modify_change_tone":"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u043e\u043d"}},"pt":{"web":{"flow_web_ext_action_ask":"Pesquisa com IA","flow_web_ext_action_explain":"Explicar","flow_web_ext_action_translate":"Traduzir","flow_web_ext_action_grammar":"Corrigir gram\xe1tica","flow_web_ext_action_rewrite":"Reescrever","flow_web_ext_contextmenu_web_bookmarks":"Adicionar uma p\xe1gina da Web aos favoritos de {brandName}","flow_web_ext_action_bookmarks":"Favorito","message_long_press_copy":"Copiar","cici_desktop_skill_make_longer":"Ampliar","cici_desktop_skill_make_shorter":"Reduzir","cici_desktop_skill_write_formally":"Escrever formalmente","cici_desktop_skill_grammar_correction":"Corre\xe7\xe3o gramatical","cici_desktop_skill_writing_improvement":"Melhoria da escrita","cici_desktop_skill_link_summary":"Resumo do link","cici_desktop_skill_write_instagram":"Escrever publica\xe7\xe3o no Instagram","cici_desktop_skill_write_twitter":"Escrever publica\xe7\xe3o no Twitter","cici_desktop_skill_tiktok_script":"Roteiro do TikTok","cici_desktop_skill_generate_weekly_report":"Gerar relat\xf3rio semanal","cici_desktop_skill_generate_OKR":"Gerar OKR","cici_desktop_skill_explain_code":"Explicar c\xf3digo","cici_desktop_skill_find_bugs":"Encontrar bugs","cici_desktop_skill_interpret_code_errors":"Interpretar erros de c\xf3digo","cici_desktop_skill_brainstorm":"Brainstorm","cici_desktop_skill_extract_todos":"Extrair Todos","cici_desktop_skill_pros_Cons":"Pr\xf3s e contras","cici_desktop_skill_extract_keywords":"Extrair palavras-chave","cici_desktop_skill_optimization_prompt":"Prompt de otimiza\xe7\xe3o","cici_desktop_skill_improve_search_keywords":"Melhorar as palavras-chave de pesquisa","flow_web_ext_contextmenu_summarize":"Fazer resumo da p\xe1gina da Web","flow_web_ext_contextmenu_translate":"Traduzir p\xe1gina da Web","flow_web_ext_contextmenu_bookmark":"Marcar p\xe1gina da Web como favorita","modify_change_tone":"Mudar o tom"}},"ms-MY":{"web":{"flow_web_ext_action_ask":"Carian AI","flow_web_ext_action_explain":"Terangkan","flow_web_ext_action_translate":"Terjemahkan","flow_web_ext_action_grammar":"Membetulkan Tatabahasa","flow_web_ext_action_rewrite":"Tulis semula","flow_web_ext_contextmenu_web_bookmarks":"Tandai Laman Web ke {brandName}","flow_web_ext_action_bookmarks":"Tanda","message_long_press_copy":"Salin","cici_desktop_skill_make_longer":"Panjangkan","cici_desktop_skill_make_shorter":"Pendekkan","cici_desktop_skill_write_formally":"Tulis secara formal","cici_desktop_skill_grammar_correction":"Pembetulan tatabahasa","cici_desktop_skill_writing_improvement":"Penambahbaikan penulisan","cici_desktop_skill_link_summary":"Pautkan rumusan","cici_desktop_skill_write_instagram":"Tulis Instagram","cici_desktop_skill_write_twitter":"Tulis Twitter","cici_desktop_skill_tiktok_script":"Skrip TikTok","cici_desktop_skill_generate_weekly_report":"Jana laporan mingguan","cici_desktop_skill_generate_OKR":"Jana OKR","cici_desktop_skill_explain_code":"Jelaskan kod","cici_desktop_skill_find_bugs":"Temukan pepijat","cici_desktop_skill_interpret_code_errors":"Tafsirkan ralat kod","cici_desktop_skill_brainstorm":"Sumbang saran","cici_desktop_skill_extract_todos":"Ekstrak Todos","cici_desktop_skill_pros_Cons":"Kebaikan & Keburukan","cici_desktop_skill_extract_keywords":"Ekstrak kata kunci","cici_desktop_skill_optimization_prompt":"Gesaan pengoptimuman","cici_desktop_skill_improve_search_keywords":"Tambah baik kata kunci carian","flow_web_ext_contextmenu_summarize":"Ringkaskan laman web","flow_web_ext_contextmenu_translate":"Terjemahkan laman web","flow_web_ext_contextmenu_bookmark":"Tandai laman web","modify_change_tone":"Ubah laras"}},"ko":{"web":{"flow_web_ext_action_ask":"AI \uac80\uc0c9","flow_web_ext_action_explain":"\uc124\uba85","flow_web_ext_action_translate":"\ubc88\uc5ed","flow_web_ext_action_grammar":"\ubb38\ubc95 \uc218\uc815","flow_web_ext_action_rewrite":"\ub2e4\uc2dc \uc4f0\uae30","flow_web_ext_contextmenu_web_bookmarks":"{brandName}\uc5d0 \uc6f9 \ud398\uc774\uc9c0 \ubd81\ub9c8\ud06c \ucd94\uac00","flow_web_ext_action_bookmarks":"\ubd81\ub9c8\ud06c","message_long_press_copy":"\ubcf5\uc0ac","cici_desktop_skill_make_longer":"\ub354 \uae38\uac8c \ub9cc\ub4e4\uae30","cici_desktop_skill_make_shorter":"\ub354 \uc9e7\uac8c \ub9cc\ub4e4\uae30","cici_desktop_skill_write_formally":"\uaca9\uc2dd \uc788\uac8c \uc791\uc131","cici_desktop_skill_grammar_correction":"\ubb38\ubc95 \uc218\uc815","cici_desktop_skill_writing_improvement":"\uae00\uc4f0\uae30 \uac1c\uc120","cici_desktop_skill_link_summary":"\ub9c1\ud06c \uc694\uc57d","cici_desktop_skill_write_instagram":"Instagram \uac8c\uc2dc\ubb3c \uc791\uc131","cici_desktop_skill_write_twitter":"Twitter \uac8c\uc2dc\ubb3c \uc791\uc131","cici_desktop_skill_tiktok_script":"TikTok \uc2a4\ud06c\ub9bd\ud2b8","cici_desktop_skill_generate_weekly_report":"\uc8fc\uac04 \ubcf4\uace0\uc11c \uc0dd\uc131","cici_desktop_skill_generate_OKR":"OKR \uc0dd\uc131","cici_desktop_skill_explain_code":"\ucf54\ub4dc \uc124\uba85","cici_desktop_skill_find_bugs":"\ubc84\uadf8 \ucc3e\uae30","cici_desktop_skill_interpret_code_errors":"\ucf54\ub4dc \uc624\ub958 \ud574\uc11d","cici_desktop_skill_brainstorm":"\ube0c\ub808\uc778\uc2a4\ud1a0\ubc0d","cici_desktop_skill_extract_todos":"\ud560 \uc77c \ucd94\ucd9c","cici_desktop_skill_pros_Cons":"\uc7a5\uc810 \ubc0f \ub2e8\uc810","cici_desktop_skill_extract_keywords":"\ud0a4\uc6cc\ub4dc \ucd94\ucd9c","cici_desktop_skill_optimization_prompt":"\ucd5c\uc801\ud654 \ud504\ub86c\ud504\ud2b8","cici_desktop_skill_improve_search_keywords":"\uac80\uc0c9 \ud0a4\uc6cc\ub4dc \uac1c\uc120","flow_web_ext_contextmenu_summarize":"\uc6f9 \ud398\uc774\uc9c0 \uc694\uc57d","flow_web_ext_contextmenu_translate":"\uc6f9 \ud398\uc774\uc9c0 \ubc88\uc5ed","flow_web_ext_contextmenu_bookmark":"\uc6f9 \ud398\uc774\uc9c0 \ubd81\ub9c8\ud06c","modify_change_tone":"\ud1a4 \ubcc0\uacbd"}},"ja":{"web":{"flow_web_ext_action_ask":"AI\u691c\u7d22","flow_web_ext_action_explain":"\u8aac\u660e","flow_web_ext_action_translate":"\u7ffb\u8a33","flow_web_ext_action_grammar":"\u6587\u6cd5\u306e\u4fee\u6b63","flow_web_ext_action_rewrite":"\u66f8\u304d\u76f4\u3059","flow_web_ext_contextmenu_web_bookmarks":"{brandName}\u306b\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u3092\u30d6\u30c3\u30af\u30de\u30fc\u30af","flow_web_ext_action_bookmarks":"\u30d6\u30c3\u30af\u30de\u30fc\u30af","message_long_press_copy":"\u30b3\u30d4\u30fc","cici_desktop_skill_make_longer":"\u9577\u304f\u3059\u308b","cici_desktop_skill_make_shorter":"\u77ed\u304f\u3059\u308b","cici_desktop_skill_write_formally":"\u6b63\u5f0f\u306a\u53e3\u8abf\u3067\u66f8\u304f","cici_desktop_skill_grammar_correction":"\u6587\u6cd5\u306e\u8a02\u6b63","cici_desktop_skill_writing_improvement":"\u6587\u7ae0\u306e\u6539\u5584","cici_desktop_skill_link_summary":"\u30ea\u30f3\u30af\u5185\u5bb9\u306e\u8981\u7d04","cici_desktop_skill_write_instagram":"\u30a4\u30f3\u30b9\u30bf\u30b0\u30e9\u30e0\u6295\u7a3f\u3092\u66f8\u304f","cici_desktop_skill_write_twitter":"\u30c4\u30a4\u30c3\u30bf\u30fc\u6295\u7a3f\u3092\u66f8\u304f","cici_desktop_skill_tiktok_script":"TikTok\u306e\u30b9\u30af\u30ea\u30d7\u30c8","cici_desktop_skill_generate_weekly_report":"\u9031\u9593\u30ec\u30dd\u30fc\u30c8\u3092\u751f\u6210\u3059\u308b","cici_desktop_skill_generate_OKR":"OKR\u3092\u751f\u6210\u3059\u308b","cici_desktop_skill_explain_code":"\u30b3\u30fc\u30c9\u3092\u8aac\u660e\u3059\u308b","cici_desktop_skill_find_bugs":"\u30d0\u30b0\u3092\u898b\u3064\u3051\u308b","cici_desktop_skill_interpret_code_errors":"\u30b3\u30fc\u30c9\u306e\u30a8\u30e9\u30fc\u3092\u89e3\u91c8\u3059\u308b","cici_desktop_skill_brainstorm":"\u30d6\u30ec\u30a4\u30f3\u30b9\u30c8\u30fc\u30df\u30f3\u30b0","cici_desktop_skill_extract_todos":"\u30bf\u30b9\u30af\u3092\u62bd\u51fa\u3059\u308b","cici_desktop_skill_pros_Cons":"\u9577\u6240\u3068\u77ed\u6240\u3092\u6bd4\u8f03\u3059\u308b","cici_desktop_skill_extract_keywords":"\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u62bd\u51fa\u3059\u308b","cici_desktop_skill_optimization_prompt":"\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u6700\u9069\u5316","cici_desktop_skill_improve_search_keywords":"\u691c\u7d22\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u6539\u5584\u3059\u308b","flow_web_ext_contextmenu_summarize":"\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u3092\u8981\u7d04\u3059\u308b","flow_web_ext_contextmenu_translate":"\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u3092\u7ffb\u8a33\u3059\u308b","flow_web_ext_contextmenu_bookmark":"\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u3092\u30d6\u30c3\u30af\u30de\u30fc\u30af","modify_change_tone":"\u30c8\u30fc\u30f3\u3092\u5909\u66f4\u3059\u308b"}},"it":{"web":{"flow_web_ext_action_ask":"Ricerca IA","flow_web_ext_action_explain":"Spiega","flow_web_ext_action_translate":"Traduci","flow_web_ext_action_grammar":"Correttore grammaticale","flow_web_ext_action_rewrite":"Riscrivi","flow_web_ext_contextmenu_web_bookmarks":"Segna questa pagina web su {brandName}","flow_web_ext_action_bookmarks":"Segnalibro","message_long_press_copy":"Copia","cici_desktop_skill_make_longer":"Allunga","cici_desktop_skill_make_shorter":"Abbrevia","cici_desktop_skill_write_formally":"Scrittura formale","cici_desktop_skill_grammar_correction":"Correzione grammaticale","cici_desktop_skill_writing_improvement":"Miglioramento della scrittura","cici_desktop_skill_link_summary":"Riassunto del link","cici_desktop_skill_write_instagram":"Scrivi Instagram","cici_desktop_skill_write_twitter":"Scrivi Twitter","cici_desktop_skill_tiktok_script":"Copione di TikTok","cici_desktop_skill_generate_weekly_report":"Genera report settimanale","cici_desktop_skill_generate_OKR":"Genera OKR","cici_desktop_skill_explain_code":"Spiega il codice","cici_desktop_skill_find_bugs":"Trova bug","cici_desktop_skill_interpret_code_errors":"Interpretare gli errori del codice","cici_desktop_skill_brainstorm":"Esegui brainstorming","cici_desktop_skill_extract_todos":"Estrai Todos","cici_desktop_skill_pros_Cons":"Pro e contro","cici_desktop_skill_extract_keywords":"Estrai parole chiave","cici_desktop_skill_optimization_prompt":"Prompt di ottimizzazione","cici_desktop_skill_improve_search_keywords":"Migliora le parole chiave di ricerca","flow_web_ext_contextmenu_summarize":"Riassumi pagina web","flow_web_ext_contextmenu_translate":"Traduci pagina web","flow_web_ext_contextmenu_bookmark":"Segna pagina web","modify_change_tone":"Cambia tono"}},"id":{"web":{"flow_web_ext_action_ask":"Pencarian AI","flow_web_ext_action_explain":"Jelaskan","flow_web_ext_action_translate":"Terjemahkan","flow_web_ext_action_grammar":"Perbaiki Tata Bahasa","flow_web_ext_action_rewrite":"Tulis ulang","flow_web_ext_contextmenu_web_bookmarks":"Markahi Halaman Web ke {brandName}","flow_web_ext_action_bookmarks":"Markahi","message_long_press_copy":"Salin","cici_desktop_skill_make_longer":"Memperpanjang","cici_desktop_skill_make_shorter":"Memperpendek","cici_desktop_skill_write_formally":"Menulis teks formal","cici_desktop_skill_grammar_correction":"Koreksi tata bahasa","cici_desktop_skill_writing_improvement":"Perbaikan penulisan","cici_desktop_skill_link_summary":"Ringkasan tautan","cici_desktop_skill_write_instagram":"Menulis postingan di Instagram","cici_desktop_skill_write_twitter":"Menulis postingan di Twitter","cici_desktop_skill_tiktok_script":"Naskah TikTok","cici_desktop_skill_generate_weekly_report":"Menghasilkan laporan mingguan","cici_desktop_skill_generate_OKR":"Menghasilkan OKR","cici_desktop_skill_explain_code":"Menjelaskan kode","cici_desktop_skill_find_bugs":"Menemukan bug","cici_desktop_skill_interpret_code_errors":"Menafsirkan kesalahan kode","cici_desktop_skill_brainstorm":"Pemikiran kreatif","cici_desktop_skill_extract_todos":"Mengekstrak Todos","cici_desktop_skill_pros_Cons":"Kelebihan & Kekurangan","cici_desktop_skill_extract_keywords":"Mengekstraksi kata kunci","cici_desktop_skill_optimization_prompt":"Prompt pengoptimalan","cici_desktop_skill_improve_search_keywords":"Meningkatkan kata kunci pencarian","flow_web_ext_contextmenu_summarize":"Rangkum halaman web","flow_web_ext_contextmenu_translate":"Terjemahkan halaman web","flow_web_ext_contextmenu_bookmark":"Markahi halaman web","modify_change_tone":"Ubah nada"}},"fr":{"web":{"flow_web_ext_action_ask":"Recherche par IA","flow_web_ext_action_explain":"Expliquer","flow_web_ext_action_translate":"Traduire","flow_web_ext_action_grammar":"Corriger la grammaire","flow_web_ext_action_rewrite":"R\xe9\xe9crire","flow_web_ext_contextmenu_web_bookmarks":"Ajouter la page Web aux favoris dans {brandName}","flow_web_ext_action_bookmarks":"Favori","message_long_press_copy":"Copier","cici_desktop_skill_make_longer":"Rallonger","cici_desktop_skill_make_shorter":"Raccourcir","cici_desktop_skill_write_formally":"\xc9crire formellement","cici_desktop_skill_grammar_correction":"Correction de la grammaire","cici_desktop_skill_writing_improvement":"Am\xe9lioration de l\'\xe9criture","cici_desktop_skill_link_summary":"R\xe9sum\xe9 du lien","cici_desktop_skill_write_instagram":"\xc9crire une publication Instagram","cici_desktop_skill_write_twitter":"\xc9crire sur Twitter","cici_desktop_skill_tiktok_script":"\xc9crire un sc\xe9nario TikTok","cici_desktop_skill_generate_weekly_report":"G\xe9n\xe9rer un rapport hebdomadaire","cici_desktop_skill_generate_OKR":"G\xe9n\xe9rer un OKR","cici_desktop_skill_explain_code":"Expliquer le code","cici_desktop_skill_find_bugs":"Trouver des bugs","cici_desktop_skill_interpret_code_errors":"Interpr\xe9ter les erreurs de code","cici_desktop_skill_brainstorm":"Remue-m\xe9ninges","cici_desktop_skill_extract_todos":"Extraire Todos","cici_desktop_skill_pros_Cons":"Avantages et inconv\xe9nients","cici_desktop_skill_extract_keywords":"Extraire des mots cl\xe9s","cici_desktop_skill_optimization_prompt":"Indication d\'optimisation","cici_desktop_skill_improve_search_keywords":"Am\xe9liorer les mots-cl\xe9s de la recherche","flow_web_ext_contextmenu_summarize":"R\xe9sumer la page\xa0Web","flow_web_ext_contextmenu_translate":"Traduire la page\xa0Web","flow_web_ext_contextmenu_bookmark":"Ajouter la page\xa0Web aux favoris","modify_change_tone":"Modifier le ton"}},"fil":{"web":{"flow_web_ext_action_ask":"AI Search","flow_web_ext_action_explain":"Ipaliwanag","flow_web_ext_action_translate":"I-translate","flow_web_ext_action_grammar":"Fix Grammar","flow_web_ext_action_rewrite":"Isulat ulit","flow_web_ext_contextmenu_web_bookmarks":"I-bookmark ang Web Page sa {brandName}","flow_web_ext_action_bookmarks":"I-bookmark","message_long_press_copy":"Kopyahin","cici_desktop_skill_make_longer":"Pahabain","cici_desktop_skill_make_shorter":"Paikliin","cici_desktop_skill_write_formally":"Magsulat nang pormal","cici_desktop_skill_grammar_correction":"Pagtatama ng grammar","cici_desktop_skill_writing_improvement":"Pagpapahusay ng pagsusulat","cici_desktop_skill_link_summary":"Buod ng link","cici_desktop_skill_write_instagram":"Magsulat sa Instagram","cici_desktop_skill_write_twitter":"Magsulat sa Twitter","cici_desktop_skill_tiktok_script":"TikTok script","cici_desktop_skill_generate_weekly_report":"Mag-generate ng lingguhang report","cici_desktop_skill_generate_OKR":"Mag-generate ng OKR","cici_desktop_skill_explain_code":"Ipaliwanag ang code","cici_desktop_skill_find_bugs":"Maghanap ng mga bug","cici_desktop_skill_interpret_code_errors":"I-interpret ang mga error sa code","cici_desktop_skill_brainstorm":"Mag-brainstorm","cici_desktop_skill_extract_todos":"I-extract ang mga Todo","cici_desktop_skill_pros_Cons":"Mga Pro at Con","cici_desktop_skill_extract_keywords":"I-extract ang mga keyword","cici_desktop_skill_optimization_prompt":"Optimization prompt","cici_desktop_skill_improve_search_keywords":"I-improve ang mga keyword sa paghahanap","flow_web_ext_contextmenu_summarize":"Ibuod ang webpage","flow_web_ext_contextmenu_translate":"Isalin ang webpage","flow_web_ext_contextmenu_bookmark":"I-bookmark ang webpage","modify_change_tone":"Baguhin ang tono"}},"es":{"web":{"flow_web_ext_action_ask":"B\xfasqueda con IA","flow_web_ext_action_explain":"Explicar","flow_web_ext_action_translate":"Traducir","flow_web_ext_action_grammar":"Corregir gram\xe1tica","flow_web_ext_action_rewrite":"Reescribir","flow_web_ext_contextmenu_web_bookmarks":"Guardar marcador de la p\xe1gina web en {brandName}","flow_web_ext_action_bookmarks":"Guardar marcador","message_long_press_copy":"Copiar","cici_desktop_skill_make_longer":"Hacer m\xe1s largo","cici_desktop_skill_make_shorter":"Hacer m\xe1s corto","cici_desktop_skill_write_formally":"Escribir formalmente","cici_desktop_skill_grammar_correction":"Correcci\xf3n gramatical","cici_desktop_skill_writing_improvement":"Mejora de la redacci\xf3n","cici_desktop_skill_link_summary":"Resumen del enlace","cici_desktop_skill_write_instagram":"Redactar para Instagram","cici_desktop_skill_write_twitter":"Redactar para Twitter","cici_desktop_skill_tiktok_script":"Guion de TikTok","cici_desktop_skill_generate_weekly_report":"Generar informe semanal","cici_desktop_skill_generate_OKR":"Generar OKR","cici_desktop_skill_explain_code":"Explicar c\xf3digo","cici_desktop_skill_find_bugs":"Buscar errores","cici_desktop_skill_interpret_code_errors":"Interpretar errores de c\xf3digo","cici_desktop_skill_brainstorm":"Lluvia de ideas","cici_desktop_skill_extract_todos":"Extraer tareas pendientes","cici_desktop_skill_pros_Cons":"Ventajas y desventajas","cici_desktop_skill_extract_keywords":"Extraer palabras clave","cici_desktop_skill_optimization_prompt":"Mensaje de optimizaci\xf3n","cici_desktop_skill_improve_search_keywords":"Mejorar las palabras clave para b\xfasquedas","flow_web_ext_contextmenu_summarize":"Resumir p\xe1gina web","flow_web_ext_contextmenu_translate":"Traducir p\xe1gina web","flow_web_ext_contextmenu_bookmark":"Guardar la p\xe1gina web en el marcador","modify_change_tone":"Cambiar el tono"}},"es-ES":{"web":{"flow_web_ext_action_ask":"B\xfasqueda con IA","flow_web_ext_action_explain":"Explicar","flow_web_ext_action_translate":"Traducir","flow_web_ext_action_grammar":"Corregir gram\xe1tica","flow_web_ext_action_rewrite":"Reescribir","flow_web_ext_contextmenu_web_bookmarks":"A\xf1adir p\xe1gina web como marcador a {brandName}","flow_web_ext_action_bookmarks":"A\xf1adir","message_long_press_copy":"Copiar","cici_desktop_skill_make_longer":"Alargar","cici_desktop_skill_make_shorter":"Acortar","cici_desktop_skill_write_formally":"Escribir formalmente","cici_desktop_skill_grammar_correction":"Correcci\xf3n gramatical","cici_desktop_skill_writing_improvement":"Mejora de la redacci\xf3n","cici_desktop_skill_link_summary":"Resumen de enlaces","cici_desktop_skill_write_instagram":"Redactar para Instagram","cici_desktop_skill_write_twitter":"Redactar para Twitter","cici_desktop_skill_tiktok_script":"Guion de TikTok","cici_desktop_skill_generate_weekly_report":"Generar informe semanal","cici_desktop_skill_generate_OKR":"Generar OKR","cici_desktop_skill_explain_code":"Explicar c\xf3digo","cici_desktop_skill_find_bugs":"Encontrar errores","cici_desktop_skill_interpret_code_errors":"Interpretar errores de c\xf3digo","cici_desktop_skill_brainstorm":"Lluvia de ideas","cici_desktop_skill_extract_todos":"Extraer tareas pendientes","cici_desktop_skill_pros_Cons":"Ventajas y desventajas","cici_desktop_skill_extract_keywords":"Extraer palabras clave","cici_desktop_skill_optimization_prompt":"Mensaje de optimizaci\xf3n","cici_desktop_skill_improve_search_keywords":"Mejorar las palabras clave de b\xfasqueda","flow_web_ext_contextmenu_summarize":"Resumir p\xe1gina web","flow_web_ext_contextmenu_translate":"Traducir p\xe1gina web","flow_web_ext_contextmenu_bookmark":"A\xf1adir p\xe1gina web a marcadores","modify_change_tone":"Cambiar tono"}},"en":{"web":{"flow_web_ext_action_ask":"AI Search","flow_web_ext_action_explain":"Explain","flow_web_ext_action_translate":"Translate","flow_web_ext_action_grammar":"Fix Grammar","flow_web_ext_action_rewrite":"Rewrite","flow_web_ext_contextmenu_web_bookmarks":"Bookmark Web Page to {brandName}","flow_web_ext_action_bookmarks":"Bookmark","message_long_press_copy":"Copy","cici_desktop_skill_make_longer":"Make longer","cici_desktop_skill_make_shorter":"Make shorter","cici_desktop_skill_write_formally":"Write formally","cici_desktop_skill_grammar_correction":"Grammar correction","cici_desktop_skill_writing_improvement":"Writing improvement","cici_desktop_skill_link_summary":"Link summary","cici_desktop_skill_write_instagram":"Write Instagram","cici_desktop_skill_write_twitter":"Write Twitter","cici_desktop_skill_tiktok_script":"TikTok script","cici_desktop_skill_generate_weekly_report":"Generate weekly report","cici_desktop_skill_generate_OKR":"Generate OKR","cici_desktop_skill_explain_code":"Explain code","cici_desktop_skill_find_bugs":"Find bugs","cici_desktop_skill_interpret_code_errors":"Interpret code errors","cici_desktop_skill_brainstorm":"Brainstorm","cici_desktop_skill_extract_todos":"Extract Todos","cici_desktop_skill_pros_Cons":"Pros & Cons","cici_desktop_skill_extract_keywords":"Extract keywords","cici_desktop_skill_optimization_prompt":"Optimization prompt","cici_desktop_skill_improve_search_keywords":"Improve search keywords","flow_web_ext_contextmenu_summarize":"Summarize webpage","flow_web_ext_contextmenu_translate":"Translate webpage","flow_web_ext_contextmenu_bookmark":"Bookmark webpage","modify_change_tone":"Change tone"}},"en-GB":{"web":{"flow_web_ext_action_ask":"AI Search","flow_web_ext_action_explain":"Explain","flow_web_ext_action_translate":"Translate","flow_web_ext_action_grammar":"Fix Grammar","flow_web_ext_action_rewrite":"Rewrite","flow_web_ext_contextmenu_web_bookmarks":"Bookmark Web Page to {brandName}","flow_web_ext_action_bookmarks":"Bookmark","message_long_press_copy":"Copy","cici_desktop_skill_make_longer":"Make longer","cici_desktop_skill_make_shorter":"Make shorter","cici_desktop_skill_write_formally":"Write formally","cici_desktop_skill_grammar_correction":"Grammar correction","cici_desktop_skill_writing_improvement":"Writing improvement","cici_desktop_skill_link_summary":"Link summary","cici_desktop_skill_write_instagram":"Write Instagram","cici_desktop_skill_write_twitter":"Write Twitter","cici_desktop_skill_tiktok_script":"TikTok script","cici_desktop_skill_generate_weekly_report":"Generate weekly report","cici_desktop_skill_generate_OKR":"Generate OKR","cici_desktop_skill_explain_code":"Explain code","cici_desktop_skill_find_bugs":"Find bugs","cici_desktop_skill_interpret_code_errors":"Interpret code errors","cici_desktop_skill_brainstorm":"Brainstorm","cici_desktop_skill_extract_todos":"Extract Todos","cici_desktop_skill_pros_Cons":"Pros & Cons","cici_desktop_skill_extract_keywords":"Extract keywords","cici_desktop_skill_optimization_prompt":"Optimisation prompt","cici_desktop_skill_improve_search_keywords":"Improve search keywords","flow_web_ext_contextmenu_summarize":"Summarise webpage","flow_web_ext_contextmenu_translate":"Translate webpage","flow_web_ext_contextmenu_bookmark":"Bookmark webpage"}},"de":{"web":{"flow_web_ext_action_ask":"KI-Suche","flow_web_ext_action_explain":"Erkl\xe4ren","flow_web_ext_action_translate":"\xdcbersetzen","flow_web_ext_action_grammar":"Grammatik korrigieren","flow_web_ext_action_rewrite":"Neu schreiben","flow_web_ext_contextmenu_web_bookmarks":"Webseite f\xfcr {brandName} als Lesezeichen speichern","flow_web_ext_action_bookmarks":"Als Lesezeichen speichern","message_long_press_copy":"Kopieren","cici_desktop_skill_make_longer":"Verl\xe4ngern","cici_desktop_skill_make_shorter":"Verk\xfcrzen","cici_desktop_skill_write_formally":"In formellem Ton schreiben","cici_desktop_skill_grammar_correction":"Grammatikkorrektur","cici_desktop_skill_writing_improvement":"Verbesserung des Geschriebenen","cici_desktop_skill_link_summary":"Linkzusammenfassung","cici_desktop_skill_write_instagram":"Schreibe einen Instagram-Beitrag","cici_desktop_skill_write_twitter":"Twitter-Beitrag schreiben","cici_desktop_skill_tiktok_script":"TikTok-Skript","cici_desktop_skill_generate_weekly_report":"W\xf6chentlichen Bericht generieren","cici_desktop_skill_generate_OKR":"OKR generieren","cici_desktop_skill_explain_code":"Code erkl\xe4ren","cici_desktop_skill_find_bugs":"Fehler finden","cici_desktop_skill_interpret_code_errors":"Codefehler interpretieren","cici_desktop_skill_brainstorm":"Brainstormen","cici_desktop_skill_extract_todos":"Aufgaben extrahieren","cici_desktop_skill_pros_Cons":"Vor- und Nachteile","cici_desktop_skill_extract_keywords":"Stichw\xf6rter extrahieren","cici_desktop_skill_optimization_prompt":"Optimierungsaufforderung","cici_desktop_skill_improve_search_keywords":"Suchbegriffe verbessern","flow_web_ext_contextmenu_summarize":"Webseite zusammenfassen","flow_web_ext_contextmenu_translate":"Webseite \xfcbersetzen","flow_web_ext_contextmenu_bookmark":"Webseite als Lesezeichen markieren","modify_change_tone":"Ton \xe4ndern"}},"ar":{"web":{"flow_web_ext_action_ask":"\u0628\u062d\u062b \u0645\u0633\u062a\u0646\u062f \u0625\u0644\u0649 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064a","flow_web_ext_action_explain":"\u062a\u0641\u0633\u064a\u0631","flow_web_ext_action_translate":"\u062a\u0631\u062c\u0645\u0629","flow_web_ext_action_grammar":"\u062a\u0635\u062d\u064a\u062d \u0627\u0644\u0623\u062e\u0637\u0627\u0621 \u0627\u0644\u0646\u062d\u0648\u064a\u0629","flow_web_ext_action_rewrite":"\u0625\u0639\u0627\u062f\u0629 \u0627\u0644\u0643\u062a\u0627\u0628\u0629","flow_web_ext_contextmenu_web_bookmarks":"\u0648\u0636\u0639 \u0625\u0634\u0627\u0631\u0629 \u0645\u0631\u062c\u0639\u064a\u0629 \u0639\u0644\u0649 \u0635\u0641\u062d\u0629 \u0627\u0644\u0648\u064a\u0628 \u0625\u0644\u0649 {brandName}","flow_web_ext_action_bookmarks":"\u0625\u0634\u0627\u0631\u0629 \u0645\u0631\u062c\u0639\u064a\u0629","message_long_press_copy":"\u0646\u0633\u062e","cici_desktop_skill_make_longer":"\u0627\u062c\u0639\u0644\u0647 \u0623\u0637\u0648\u0644","cici_desktop_skill_make_shorter":"\u0627\u062c\u0639\u0644\u0647 \u0623\u0642\u0635\u0631","cici_desktop_skill_write_formally":"\u0627\u0643\u062a\u0628 \u0628\u0634\u0643\u0644 \u0631\u0633\u0645\u064a","cici_desktop_skill_grammar_correction":"\u062a\u0635\u062d\u064a\u062d \u0627\u0644\u0642\u0648\u0627\u0639\u062f \u0627\u0644\u0644\u063a\u0648\u064a\u0629","cici_desktop_skill_writing_improvement":"\u062a\u062d\u0633\u064a\u0646 \u0627\u0644\u0643\u062a\u0627\u0628\u0629","cici_desktop_skill_link_summary":"\u0645\u0644\u062e\u0635 \u0627\u0644\u0631\u0627\u0628\u0637","cici_desktop_skill_write_instagram":"\u0627\u0643\u062a\u0628 \u0639\u0644\u0649 Instagram","cici_desktop_skill_write_twitter":"\u0627\u0643\u062a\u0628 \u0639\u0644\u0649 Twitter","cici_desktop_skill_tiktok_script":"\u0646\u0635 TikTok","cici_desktop_skill_generate_weekly_report":"\u0625\u0646\u0634\u0627\u0621 \u062a\u0642\u0631\u064a\u0631 \u0623\u0633\u0628\u0648\u0639\u064a","cici_desktop_skill_generate_OKR":"\u0625\u0646\u0634\u0627\u0621 OKR","cici_desktop_skill_explain_code":"\u062a\u0641\u0633\u064a\u0631 \u0627\u0644\u0631\u0645\u0632","cici_desktop_skill_find_bugs":"\u0627\u0644\u0628\u062d\u062b \u0639\u0646 \u0627\u0644\u0623\u062e\u0637\u0627\u0621","cici_desktop_skill_interpret_code_errors":"\u062a\u0641\u0633\u064a\u0631 \u0623\u062e\u0637\u0627\u0621 \u0627\u0644\u0631\u0645\u0648\u0632","cici_desktop_skill_brainstorm":"\u0627\u0644\u0639\u0635\u0641 \u0627\u0644\u0630\u0647\u0646\u064a","cici_desktop_skill_extract_todos":"\u0627\u0633\u062a\u062e\u0631\u0627\u062c \u0627\u0644\u0645\u0647\u0627\u0645","cici_desktop_skill_pros_Cons":"\u0627\u0644\u0625\u064a\u062c\u0627\u0628\u064a\u0627\u062a \u0648\u0627\u0644\u0633\u0644\u0628\u064a\u0627\u062a","cici_desktop_skill_extract_keywords":"\u0627\u0633\u062a\u062e\u0631\u0627\u062c \u0627\u0644\u0643\u0644\u0645\u0627\u062a \u0627\u0644\u0631\u0626\u064a\u0633\u064a\u0629","cici_desktop_skill_optimization_prompt":"\u0637\u0644\u0628 \u0627\u0644\u062a\u062d\u0633\u064a\u0646","cici_desktop_skill_improve_search_keywords":"\u062a\u062d\u0633\u064a\u0646 \u0627\u0644\u0643\u0644\u0645\u0627\u062a \u0627\u0644\u0631\u0626\u064a\u0633\u064a\u0629 \u0644\u0644\u0628\u062d\u062b","flow_web_ext_contextmenu_summarize":"\u062a\u0644\u062e\u064a\u0635 \u0635\u0641\u062d\u0629 \u0627\u0644\u0648\u064a\u0628","flow_web_ext_contextmenu_translate":"\u062a\u0631\u062c\u0645\u0629 \u0635\u0641\u062d\u0629 \u0627\u0644\u0648\u064a\u0628","flow_web_ext_contextmenu_bookmark":"\u0648\u0636\u0639 \u0625\u0634\u0627\u0631\u0629 \u0645\u0631\u062c\u0639\u064a\u0629 \u0639\u0644\u0649 \u0635\u0641\u062d\u0629 \u0627\u0644\u0648\u064a\u0628","modify_change_tone":"\u062a\u063a\u064a\u064a\u0631 \u0627\u0644\u0623\u0633\u0644\u0648\u0628"}}}'),tv=()=>{var e;return null===(e=Va("collectionConfig"))||void 0===e?void 0:e.showEntry},nv=()=>{chrome.contextMenus.removeAll();const e="samantha_page_menu";chrome.contextMenus.create({id:e,type:"normal",title:"\u8c46\u5305",contexts:["page"]});const t=[{id:"page-summarize",type:"normal",title:gd.t("flow_web_ext_contextmenu_summarize"),contexts:["page"]},{id:"page-translate",type:"normal",title:gd.t("flow_web_ext_contextmenu_translate"),contexts:["page"]}];tv()&&t.push({id:"collect_page",type:"normal",title:gd.t("flow_web_ext_contextmenu_bookmark"),contexts:["page"]}),t.forEach((t=>{chrome.contextMenus.create(l(l({},t),{},{parentId:e}))}));const{actionList:n=[]}=Va("readingPopupActions"),{actionList:r=[]}=Va("editingPopupActions"),i=new Map;if([...sa].forEach((e=>{if(_a[e]){const{name:t}=_a[e];i.set(e,{id:e,title:gd.t(t),contexts:["selection"]})}})),n.forEach((e=>{const{id:t,name:n}=e;i.has(t)||i.set(t,{id:t,title:gd.t(n),contexts:["selection"]})})),r.forEach((e=>{const{id:t,name:n}=e;i.has(t)||i.set(t,{id:t,title:gd.t(n),contexts:["editable"]})})),1===i.size){const e=[...i][0][1];chrome.contextMenus.create(e)}else{const e="samantha_selection_menu";chrome.contextMenus.create({id:e,type:"normal",title:"\u8c46\u5305",contexts:["selection"]}),i.forEach((t=>{chrome.contextMenus.create(l(l({},t),{},{parentId:e}))}))}},rv=()=>{nv(),chrome.contextMenus.onClicked.addListener(function(){var e=o((function*(e,t){const n={actionKey:e.menuItemId,selectionText:e.selectionText},r="content-menu-click";if(null==t||!t.id||t.id<=0){const e=yield chrome.tabs.query({currentWindow:!0,active:!0});e.length&&Eo({name:r,tabId:e[0].id,body:n})}else Eo({name:r,tabId:null==t?void 0:t.id,body:n})}));return function(t,n){return e.apply(this,arguments)}}()),ks.watch({readingPopupActions:()=>{nv()},editingPopupActions:()=>{nv()},uiLanguage:()=>{nv()},tccConfig:()=>{nv()},navigatorLanguage:()=>{nv()}})};const iv="586864",ov="public";function sv(){return av.apply(this,arguments)}function av(){return(av=o((function*(){const e=yield chrome.runtime.getPlatformInfo(),t=Us,n=yield of({url:t,method:"GET",params:{aid:iv||"",device_id:Rd(),channel:ov,os:e.os,arch:e.arch,version_code:wo(),browser:g()?"edge":v()?"safari":"chrome"}});if("success"===n.message&&Object.keys(n.data.settings||{}).length>0)return n.data.settings;throw new Error("failed to load appsettings")}))).apply(this,arguments)}const cv=function(){var e=o((function*(){try{var e;const i=yield(t=sv,n=3,r=1e4,new Promise(((e,i)=>{let o=0;!function s(){t().then(e).catch((e=>{o<n?(o++,setTimeout(s,r)):i(e)}))}()}))),o=null==i||null===(e=i.writing_assistant)||void 0===e?void 0:e.default_open,s=Ja("writing_assistant");"boolean"==typeof o&&o!==s.default_open&&za("InputAssistantDisabledAll",!o);const a=Va("readWebPageCtxConfig"),c=Ja("read_webpage_context");a.hasUserSwitched||za("readWebPageCtxConfig",{hasUserSwitched:!1,enabled:c.default_enable_context,hasWebPageContextDialogShow:c.default_enable_context});const u=ps(i,Gs);za("appSettings",u)}catch(i){}var t,n,r;setTimeout(cv,36e5)}));return function(){return e.apply(this,arguments)}}();function uv(e,t){e.forEach((e=>{!function(e,t){e.forEach((e=>{e.js&&0!==e.js.length&&chrome.scripting.executeScript({files:e.js,target:{tabId:t}}).catch((e=>{oc.persist.error({message:"hotupdate inject failed",error:e})}))}))}(t,e)}))}function lv(){return chrome.runtime.getManifest().content_scripts||[]}function dv(){const e=lv();chrome.tabs.query({windowType:"normal",status:"complete"},(t=>{const n=t.filter((e=>{var t,n,r;return!!e.id&&!(!e.url||!e.url.length||null!==(t=e.url)&&void 0!==t&&t.startsWith("chrome://")||null!==(n=e.url)&&void 0!==n&&n.startsWith("edge://")||null!==(r=e.url)&&void 0!==r&&r.startsWith("extension://"))}));!function(e){const t=new Set;e.filter((e=>!e.active)).forEach((e=>t.add(e.id))),chrome.tabs.onActivated.addListener((e=>{t.has(e.tabId)&&(t.delete(e.tabId),uv([e.tabId],lv()))}))}(n),uv(n.filter((e=>e.active)).map((e=>e.id)),e)}))}function fv(){za("hostId",Ea())}const pv=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return J(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Hp(e,t,{leading:r,maxWait:t,trailing:i})},hv=e=>(t,n,r)=>{const i=r.subscribe;r.subscribe=(e,t,n)=>{let o=e;if(t){const i=(null==n?void 0:n.equalityFn)||Object.is;let s=e(r.getState());o=n=>{const r=e(n);if(!i(s,r)){const e=s;t(s=r,e)}},(null==n?void 0:n.fireImmediately)&&t(s,s)}return i(o)};return e(t,n,r)};const mv=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!=typeof i)?i:Object.assign({},t,i),n.forEach((n=>n(t,e)))}},i=()=>t,o={setState:r,getState:i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}};return t=e(r,i,o),o},_v=e=>e?mv(e):mv;var gv=n(53954);const{useSyncExternalStoreWithSelector:vv}=gv;const yv=e=>{const t="function"==typeof e?_v(e):e,n=(e,n)=>function(e,t=e.getState,n){const r=vv(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return(0,vd.useDebugValue)(r),r}(t,e,n);return Object.assign(n,t),n},bv=e=>e?yv(e):yv;const wv={isShowSidebar:!1,isShowSidebarBtn:!0,isShowSearch:!0,isShowQuick:!0,isShowLinkPreview:!0,isShowVideo:!0,enterSidebarMode:function(e){return e.clickSidebar="click_side_bar",e.selectAssistantMenu="highlight_function_bar",e.selectAssistantResult="highlight_result_card",e.searchAssistant="search_result_card",e.videoAssistant="video_page_summarize",e.podcastAssistant="podcast_page_summarize",e.onboarding="onboarding",e.chatHeader="chat_header",e.disableMenu="close_function",e.screenCapture="screenshot",e.searchPreview="search_preview",e.textInputBox="text_input_box",e.other="other",e.default="default",e}({}).default,showTip:!0,isSidePanelMode:!1,isShowReplyBtn:!0},kv=bv()(hv(((e,t)=>l(l({},wv),{},{setIsShowSidebar:(n,r)=>e((()=>t().isSidePanelMode?(ho(n?"open-side-panel":"close-side-panel"),{isShowSidebar:!1,enterSidebarMode:r}):{isShowSidebar:n,enterSidebarMode:r})),toggleShowSidebar:n=>e((e=>{if(t().isSidePanelMode)return ho("toggle-side-panel"),{isShowSidebar:!1,enterSidebarMode:n};return{isShowSidebar:!e.isShowSidebar,enterSidebarMode:n}})),setIsShowSidebarBtn:t=>e((()=>({isShowSidebarBtn:t}))),setIsShowSearch:t=>e((()=>({isShowSearch:t}))),setIsShowQuick:t=>e((()=>({isShowQuick:t}))),setIsShowLinkPreview:t=>e((()=>({isShowLinkPreview:t}))),setIsShowVideo:t=>e((()=>({isShowVideo:t}))),setTipVisible:t=>e((()=>({showTip:t}))),setIsSidePanelMode:t=>e({isSidePanelMode:t}),setIsShowReplyBtn:t=>e({isShowReplyBtn:t})}))));Za.getInstance().registerStore("useLayoutStore",kv);const Ev=new class{constructor(){c(this,"containers",new Map)}getAssistantContainer(){return this.getContainerById(Na)}getAssistantShadowContent(){return this.getShadowRootContainerByID(Na)}getContainerById(e){var t;return null===(t=this.containers.get(e))||void 0===t?void 0:t.container}getShadowRootById(e){var t;return null===(t=this.containers.get(e))||void 0===t?void 0:t.shadowRoot}getShadowRootContainerByID(e){var t;return null===(t=this.containers.get(e))||void 0===t?void 0:t.shadowContent}getCommonPopupContainer(){return this.getShadowRootContainerByID("common-inner-popup-container")}getCommonPopupRootContainer(){return this.getContainerById("common-inner-popup-container")}recordAssistantContainer(e,t,n){this.recordContainer(Na,e,t,n)}recordContainer(e,t,n,r){const i=this.containers.get(e)||{};Object.assign(i,{container:t}),n&&Object.assign(i,{shadowRoot:n}),r&&Object.assign(i,{shadowContent:r}),this.containers.set(e,i)}release(){this.containers.clear()}};ec((()=>{Ev.release()}));class Sv{constructor(){c(this,"observer",void 0),c(this,"_resizeListener",pv((()=>{var e;const{isSidePanelMode:t,isShowSidebar:n}=kv.getState();if(t||!n)return void this.moveAssist2VideoRight();const r=document.querySelector(this.getVideoRightSelector()),i=Ev.getAssistantContainer();if(!r||!i)return;const o=null===(e=Ev.getAssistantShadowContent())||void 0===e?void 0:e.querySelector("[class*=chatBoxContainer-]");if(!o)return;const s=r.getBoundingClientRect(),a=o.getBoundingClientRect();a.x<=s.x||s.left<a.left&&s.right>a.left?this.moveAssist2VideoBottom():this.moveAssist2VideoRight()}),100))}init(){this.observer||(this.observer=new ResizeObserver(this._resizeListener),this.observer.observe(document.body))}release(){var e,t;null===(e=document.querySelector(this.getAssistantId()))||void 0===e||e.remove(),null===(t=this.observer)||void 0===t||t.unobserve(document.body),this.observer=void 0}getAssistantId(){const e=Za.getInstance().getHostId();return`${Aa}-${e}`}findAssistant(){const e=this.getAssistantId(),t=Ev.getContainerById(e);return null!=t&&t.parentElement?t:null}}new class extends Sv{enable(){return Fd()}getVideoBottomSelector(){return"#primary #primary-inner"}getVideoRightSelector(){return document.querySelector("#columns #secondary")?"#columns #secondary":"#fixed-columns-secondary #secondary"}moveAssist2VideoRight(){const e=this.findAssistant(),t=document.querySelector(this.getVideoRightSelector());t&&e&&(null==e?void 0:e.parentElement)!==t&&(e.style.marginTop="",t.prepend(e))}moveAssist2VideoBottom(){const e=this.findAssistant(),t=document.querySelector(this.getVideoBottomSelector()),n=document.querySelector("#primary #below");e&&t&&n&&e.parentElement!==t&&(e.style.marginTop="10px",t.insertBefore(e,n))}},new class extends Sv{constructor(...e){super(...e),c(this,"bilibili_mount_config",void 0)}getVideoRightSelector(){return this.getMountConfig().container_selector}enable(){return Ud()}getMountConfig(){return this.bilibili_mount_config||(this.bilibili_mount_config=function(){const{bilibili_mount_config:e}=Ja("video_assistant"),t=[];Array.isArray(e)?t.push(...e):t.push(e);let n=t[0];for(const r of t)if(document.querySelector(r.container_selector)){n=r;break}return n}()),this.bilibili_mount_config}moveAssist2VideoRight(){const{mount_position:e,is_child:t}=this.getMountConfig(),n=this.findAssistant();let r=document.querySelector(this.getVideoRightSelector());var i;t||(r=null===(i=r)||void 0===i?void 0:i.parentElement);if(r&&n&&(null==n?void 0:n.parentElement)!==r)if(n.style.marginTop="","before"===e)r.prepend(n);else if("after"===e)r.appendChild(n);else{const t=r.childNodes[e];t?r.insertBefore(n,t):r.appendChild(n)}}moveAssist2VideoBottom(){const e=this.findAssistant(),t=document.querySelector(".left-container"),n=document.querySelector(".left-container-under-player");e&&t&&n&&e.parentElement!==t&&(e.style.marginTop="10px",t.insertBefore(e,n))}};function Tv(e=0){return new Promise((t=>setTimeout(t,e)))}const Iv=new Set(["710022013","710012001"]),xv=function(){var e=o((function*(e,t){try{const{data:n,success:r,error:i}=yield ho({name:"http-request",body:{config:e,options:t}});if(Iv.has(`${null==n?void 0:n.code}`)&&nf.emit("api-request-proxy-unAuthorized",{params:e,data:n}),!r)throw i;const{code:o,msg:s,data:a}=n;if(void 0!==o&&0!==o)throw new Error(JSON.stringify({message:`code invalid error: ${o}, ${s}`,code:o}));return a}catch(n){return n}}));return function(t,n){return e.apply(this,arguments)}}();function Ov(){return(Ov=o((function*(e){const t=Va("authInfo");return e?yield sf({method:"POST",url:`${Ps}/plugin/prompt_skill/list_by_user`,data:{user_id:t.userId,frontend_source:1}}):yield xv({method:"POST",url:`${Ps}/plugin/prompt_skill/list_by_user`,data:{user_id:t.userId,frontend_source:1}})}))).apply(this,arguments)}const Nv=()=>{const e=[],{selectBarPronounceEnabled:t}=Ja("tts");return t||e.push(Ks),tv()||e.push(na),Ja("selection_bar").diagram_enabled||e.push(ia),e},Av=(e,t,n)=>{const r={actionList:[],moreActionList:[]},i=new Set,o=Nv();return e&&(e.selectbar.forEach((e=>{if(o.includes(e))return;const n=t.get(e);n&&(r.actionList.push(n),i.add(e))})),e.dropdown.forEach((e=>{if(o.includes(e))return;const n=t.get(e);n&&(r.moreActionList.push(n),i.add(e))}))),t.forEach(((e,t)=>{if(!i.has(t)&&!o.includes(t)){(n?aa.includes(t):fa.includes(t))?r.actionList.push(e):r.moreActionList.push(e)}})),r},Rv={readingPopupActions:{selectbar:aa,dropdown:ca},editingPopupActions:{selectbar:fa,dropdown:pa}},Lv=()=>{const e=Nv();za("readingPopupActions",{actionList:la(e),moreActionList:da(e)}),za("editingPopupActions",{actionList:ha(e),moreActionList:ma(e)})};function Cv(){return Pv.apply(this,arguments)}function Pv(){return Pv=o((function*(){return yield function(){return Mv.apply(this,arguments)}(!0)})),Pv.apply(this,arguments)}function Mv(){return Mv=o((function*(e=!1){try{const t=Va("authInfo");if(!t.isAuthenticated||!t.userId)return void Lv();const n=yield function(e){return Ov.apply(this,arguments)}(e);if(!n)return;const{user_setting:r,items:i}=n;if(!r||!i)return;const o=new Map([...la(),...da()].map((e=>[e.id,e]))),s=new Map([...ha(),...ma()].map((e=>[e.id,e])));null==i||i.forEach((e=>{const{id:t,extra:n,title:r,prompt_template:i}=e,a=JSON.parse(n),{use_in:c="",icon:u="",displayMode:l,conf_id:d}=a||{},f={id:t,icon:u,name:r,prompt:i,displayMode:l,confId:d};"editing"===c?s.set(t,f):o.set(t,f)}));const{settings:a=""}=r,c=a?JSON.parse(a):Rv,u=Av(c.readingPopupActions,o,!0),l=Av(c.editingPopupActions,s,!1);u.actionList.length+u.moreActionList.length&&za("readingPopupActions",u),l.actionList.length+l.moreActionList.length&&za("editingPopupActions",l)}catch(t){fo("initSelectBarSkillList err",t),oc.persist.info({eventName:"getSelectBarSkillList",meta:l({},t)})}})),Mv.apply(this,arguments)}const Dv={name:"is-on-toolbar",handle:function(){var e=o((function*(){var e;if("function"==typeof(null===(e=chrome)||void 0===e||null===(e=e.action)||void 0===e?void 0:e.getUserSettings)){const{isOnToolbar:e}=yield chrome.action.getUserSettings();return{isOnToolbar:e}}return{isOnToolbar:!1}}));return function(){return e.apply(this,arguments)}}()},jv={name:"call-background-method",handle(e,t){if("is-on-toolbar"===(null==e?void 0:e.method))return Dv.handle(e,t)}},Bv=function(){var e=o((function*(){try{const r={aid:Number(Ls),service:Rs,unionHost:"",union:!1,needFid:!1,fid:"",migrate_priority:0};let i=yield(yield fetch(`https://${Rs}/ttwid/check/`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/x-www-form-urlencoded"}})).json();if(0!==i.status_code){var e,t,n;const o=yield fetch(`https://${Rs}/ttwid/register/`,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/x-www-form-urlencoded"}}),s=null===(e=o.headers)||void 0===e||null===(t=e.get)||void 0===t?void 0:t.call(e,"x-tt-logid");if(i=yield o.json(),!o.ok||0!==(null===(n=i)||void 0===n?void 0:n.status_code))throw new Error(`register ttwid failed - ${s}`);return{updated:!0,success:!0}}return{updated:!1,success:!0}}catch(r){return Zd.sendEvent({name:"ttwid-check-failed",categories:{errorMessage:null==r?void 0:r.message}}),fo("check ttwid error"),{updated:!1,success:!1}}}));return function(){return e.apply(this,arguments)}}(),Fv={name:"check-and-update-ttwid",handle:function(){var e=o((function*(){return yield Bv()}));return function(){return e.apply(this,arguments)}}()},Uv={name:"tab-info",handle:function(){var e=o((function*(){const e=yield yo();return{tabId:e?e.id:void 0}}));return function(){return e.apply(this,arguments)}}()},Gv={name:"close-side-panel",handle:()=>{Ap()}};let qv=function(e){return e.click_side_bar="click_side_bar",e.first_login="first_login",e.web_extension="web_extension",e.highlight_search_result_go_chat="highlight_search_result_go_chat",e.highlight_search_result_head="highlight_search_result_head",e.search_card_go_chat="search_card_go_chat",e.search_related_suggested_prompt="search_related_suggested_prompt",e.search_card_head="search_card_head",e}({});const Wv=e=>{chrome.commands.getAll((function(t){const n={};t.forEach((e=>{e.name&&(n[e.name]=e.shortcut)})),e({shortcuts:n})}))},zv={name:"csui-init",handle:function(){var e=o((function*(e,t){const n=yield ks.get(Cs);var r;n&&(n===(null==t||null===(r=t.tab)||void 0===r?void 0:r.id)&&(yield Eo({tabId:n,name:"open-cici-sidebar",body:{enterSidebarMode:qv.first_login}})),ks.set(Cs,0));return new Promise((e=>{Wv((({shortcuts:t})=>{e({shortcuts:t})}))}))}));return function(t,n){return e.apply(this,arguments)}}()},Vv={name:"devtool",handle:e=>{const{eventName:t}=e||{};if("start-listen-perf"===t)return new Promise((e=>{(t=>{e({message:t})})(Xd)}))}},Jv={name:"fetch-stream",handle:(e,t)=>{var n;if(!e)return;const{id:r,type:i,payload:o,reason:s}=e;if("abort"===i)return void Wg(r,s);const a=null==t||null===(n=t.tab)||void 0===n?void 0:n.id,c=e=>{Eo({tabId:a,name:"fetch-stream",body:e})},{req:{url:u,body:d}}=o,f=Cd();Zd.sendEvent(l({name:"request_start"},j({url:u,localRequestId:r,isSse:!0,"x-tt-env":null==f?void 0:f["x-tt-env"]}))),zg({id:r,url:jd(u,Ld()),req:{headers:f,body:JSON.stringify(d)},onOpen(e){var t;const{jsonData:n,logId:i,status:o=200}=e,s=Number(null!==(t=null==n?void 0:n.code)&&void 0!==t?t:0);0!==s&&Zd.sendEvent(l({name:"response_server_code_invalid"},j({url:u,msg:(null==n?void 0:n.msg)||"",code:`${s}`,statusCode:o,logId:i,localRequestId:r,isSse:!0,"x-tt-env":null==f?void 0:f["x-tt-env"]}))),[Pd.NOACCESS,Pd.NOT_LOGIN].includes(s)&&nf.emit("auth-info-request-updated")},onFinish(e){c(e)},onUpdate(e){c(e)},onError(e){const{code:t,message:n="",logId:i,status:o=200}=e;Zd.sendEvent(l({name:"response_server_error"},j({url:u,message:n,code:`${t}`,statusCode:o,logId:i,localRequestId:r,isSse:!0,"x-tt-env":null==f?void 0:f["x-tt-env"]}))),c(e)},onAbort(e){c(e)},onClose(e){c(e)}})}},Hv={name:"get-conversation-id",handle:function(){var e=o((function*(){try{var e;const{main_thread:t}=yield If();return(null==t||null===(e=t.conversation)||void 0===e?void 0:e.conversation_id)||""}catch(t){return""}}));return function(){return e.apply(this,arguments)}}()},Kv={name:"get-window-info",handle:function(){var e=o((function*(e,t){const{useAuthInfoCache:n=!0}=null!=e?e:{};return n||(yield Bf({reason:"get window info: no cache"})),Af({tab:null==t?void 0:t.tab})}));return function(t,n){return e.apply(this,arguments)}}()},$v={name:"http-request",handle:e=>{const{config:t,options:n}=e||{};return of(t,n)}},Yv={name:"init-shortcut",handle:function(){var e=o((function*(){return new Promise((e=>{Wv((({shortcuts:t})=>{e({shortcuts:t})}))}))}));return function(){return e.apply(this,arguments)}}()},Xv={name:"is-side-panel-enabled",handle:function(){var e=o((function*(){return{enabled:yield Op()}}));return function(){return e.apply(this,arguments)}}()},Qv={name:"logout",handle:function(){var e=o((function*(e,t){return yield function(){return Wf.apply(this,arguments)}(),Af({tab:null==t?void 0:t.tab})}));return function(t,n){return e.apply(this,arguments)}}()},Zv={name:"open-debug-page",handle:e=>{const t=new URLSearchParams(e).toString();var n;chrome.tabs.create({url:(n=t?`?${t}`:"",chrome.runtime.getURL(`debug.html${null!=n?n:""}`))})}},ey={windowId:0,tabId:0},ty=(()=>{let e=!1;return()=>{e||(chrome.windows.onRemoved.addListener((e=>{e===ey.windowId&&(ey.windowId=void 0)})),e=!0)}})(),ny=(()=>{let e=0;return()=>{clearTimeout(e),e=setTimeout((()=>{ey.windowId=void 0}),3e5)}})(),ry={name:"open-login-window",handle:function(){var e=o((function*(e){const{trackMeta:t,clearWindow:n=!1}=e||{};try{if(ty(),n&&ey.windowId&&(yield chrome.windows.remove(ey.windowId),ey.windowId=void 0),ey.windowId){const{id:e}=yield chrome.windows.getCurrent();e!==ey.windowId&&chrome.windows.update(ey.windowId,{focused:!0})}else{var r;const{id:n,tabs:i}=yield function(e){return Sf.apply(this,arguments)}(l({url:Bd(Ia,{onboarding:"false"},{trackMeta:t})},e||{}));ey.tabId=null==i||null===(r=i[0])||void 0===r?void 0:r.id,ey.windowId=n,ny()}return{windowId:ey.windowId,tabId:ey.tabId}}catch(i){return oc.persist.info({eventName:"open_login_window_error",meta:l({},j({message:null==i?void 0:i.message}))}),{windowId:0,tabId:0}}}));return function(t){return e.apply(this,arguments)}}()},iy={name:"open-options-page",handle:e=>{const t=new URLSearchParams(e).toString();var n;chrome.tabs.create({url:(n=t?`?${t}`:"",chrome.runtime.getURL(`options.html${null!=n?n:""}`))})}},oy={name:"open-side-panel",handle:(e,t)=>{var n;const r=null==t||null===(n=t.tab)||void 0===n?void 0:n.windowId;r&&Np(r)}},sy={name:"screen-capture",handle:()=>({message:"screen captured",body:"hello"})},ay={name:"start-try-summarize",handle:function(){var e=o((function*(e,t){var n;(yield Op())&&Np(null==t||null===(n=t.tab)||void 0===n?void 0:n.windowId);chrome.tabs.create({url:"https://36kr.com/p/997609012833538#onboarding_have_a_try"})}));return function(t,n){return e.apply(this,arguments)}}()},cy={name:"start-using",handle:(e,t)=>{var n;return Eo({tabId:null==t||null===(n=t.tab)||void 0===n?void 0:n.id,name:"open-cici-sidebar",body:{enterSidebarMode:qv.first_login}}),Af({tab:null==t?void 0:t.tab})}},uy={name:"toggle-side-panel",handle:(e,t)=>{var n;const r=null==t||null===(n=t.tab)||void 0===n?void 0:n.windowId;r&&Lp(r)}},ly={name:"update-auth-info",handle:function(){var e=o((function*(e,t){var n;return Ef(null==t?void 0:t.tab)&&null!=e&&e.isLogin&&null!==(n=yf)&&void 0!==n&&n.id&&(bf&&yf.id===wf&&bf!==wf&&chrome.windows.update(bf,{focused:!0}),chrome.windows.remove(yf.id)),yield Bf({immediately:!0,reason:null==e?void 0:e.reason}),Af({tab:null==t?void 0:t.tab})}));return function(t,n){return e.apply(this,arguments)}}()},dy={name:"update-web-hit-status",handle:function(){var e=o((function*(e){try{yield function(e){return Mf.apply(this,arguments)}(null==e?void 0:e.status)}catch(t){}}));return function(t){return e.apply(this,arguments)}}()},fy={name:"capture-visible-tab",handle:function(){var e=o((function*(){return new Promise((e=>{chrome.tabs.captureVisibleTab((t=>e(t)))}))}));return function(){return e.apply(this,arguments)}}()},py={name:"remove-fetch-cross-header",handle:e=>{/[0-9]+/.test(e)&&function(e){chrome.declarativeNetRequest.updateSessionRules({removeRuleIds:e})}([Number.parseInt(e)])}};const hy={name:"add-fetch-cross-header",handle:function(){var e=o((function*(e){const t=yield function(e){return my.apply(this,arguments)}(e);return t}));return function(t){return e.apply(this,arguments)}}()};function my(){return my=o((function*(e){const t=(yield chrome.declarativeNetRequest.getSessionRules()).filter((e=>e.id>=100)).map((e=>e.id)).sort(),n=t.length>0?t[t.length-1]+1:100,r={addRules:[{id:n,action:{type:chrome.declarativeNetRequest.RuleActionType.MODIFY_HEADERS,responseHeaders:[{header:"Access-Control-Allow-Origin",operation:chrome.declarativeNetRequest.HeaderOperation.SET,value:"*"}]},condition:{urlFilter:e,requestMethods:[chrome.declarativeNetRequest.RequestMethod.GET],resourceTypes:[chrome.declarativeNetRequest.ResourceType.XMLHTTPREQUEST]}}]};return yield chrome.declarativeNetRequest.updateSessionRules(r),n})),my.apply(this,arguments)}const _y="receive_tts_audio",gy="wss://ws-samantha.doubao.com/samantha/audio/tts";class vy{sendTTSDataByScene(e){"sidepanel"===this.scene?mo(e):Io(e)}constructor(e,t){c(this,"id",Ea()),c(this,"ws",void 0),c(this,"originText",void 0),c(this,"scene",void 0),c(this,"currentOrder",-1),c(this,"blobsForCurrentSentence",[]),c(this,"handleNewBlob",(e=>{this.blobsForCurrentSentence.push(e)})),c(this,"handleCurrentSentenceEnd",(()=>{const e=new Blob(this.blobsForCurrentSentence,{type:"audio/wav"});this.blobsForCurrentSentence=[];const t=new FileReader;t.readAsDataURL(e);const n=this.currentOrder+1;this.currentOrder=n,t.onloadend=()=>{const e=t.result;this.sendTTSDataByScene({name:_y,body:{id:this.id,data:{type:"update",content:{order:n,url:e}}}})}})),c(this,"handleTTSMessageEnd",(()=>{var e;null===(e=this.ws)||void 0===e||e.close();const t=this.currentOrder;this.sendTTSDataByScene({name:_y,body:{id:this.id,data:{type:"finished",content:t+1}}})})),c(this,"handleErrorMsg",((e,t)=>{this.sendTTSDataByScene({name:_y,body:{id:this.id,data:{type:"error",content:`TTS SERVER ERROR - ${e} : ${t}`}}})})),c(this,"handleMessage",(e=>{const{data:t}=e;if(P(t)){const e=JSON.parse(t);"sentence_end"===e.event&&this.handleCurrentSentenceEnd(),"finish"===e.event&&this.handleTTSMessageEnd(),e.message&&this.handleErrorMsg(e.code,e.message)}else this.handleNewBlob(t)})),c(this,"start",(e=>{var t;const n=Gd(l({speaker:e||(null===(t=Va("voiceSpeaker"))||void 0===t?void 0:t.style_id)},Ld()));this.ws=new WebSocket(`${gy}?${n}`),this.ws.onopen=()=>{var e,t;const n={event:"text",text:this.originText};null===(e=this.ws)||void 0===e||e.send(JSON.stringify(n));null===(t=this.ws)||void 0===t||t.send(JSON.stringify({event:"finish"}))},this.ws.onmessage=this.handleMessage})),c(this,"getId",(()=>this.id)),this.originText=e,this.scene=t}}const yy={name:"request_tts_audio",handle:e=>{const{text:t,speakerId:n,scene:r}=e,i=new vy(t,r);return i.start(n),i.getId()}};var by;class wy{sendTTSDataByScene(e){"sidepanel"===this.scene?mo(e):Io(e)}constructor(e,t,n){var r=this;c(this,"id",void 0),c(this,"speakerId",void 0),c(this,"joinBySentence",!1),c(this,"order",0),c(this,"bufferSentCount",0),c(this,"ws",void 0),c(this,"msgSent",!1),c(this,"scene",void 0),c(this,"timeoutTimer",-1),c(this,"currentSentence",{text:"",sound:[]}),c(this,"sendBufferToContent",(()=>{const e=new Blob(this.currentSentence.sound),t=this.currentSentence.text;this.currentSentence.sound=[];const n=new FileReader;n.readAsDataURL(e);const r=this.order;this.order+=1,n.onloadend=()=>{const e=n.result;this.sendTTSDataByScene({name:_y,body:{id:this.id,data:{type:"update",content:{order:r,url:e,text:t}}}}),this.bufferSentCount+=1}})),c(this,"handleCurrentSentenceEnd",(()=>{this.joinBySentence=!0,this.currentSentence.sound.length&&this.sendBufferToContent()})),c(this,"handleNewBlob",(e=>{this.resetTimeoutTimer(),this.currentSentence.sound.push(e),this.joinBySentence||this.currentSentence.sound.length>5&&this.sendBufferToContent()})),c(this,"handleTTSMessageEnd",(()=>{var e;clearTimeout(this.timeoutTimer),null===(e=this.ws)||void 0===e||e.close(),this.bufferSentCount===this.order?this.sendTTSDataByScene({name:_y,body:{id:this.id,data:{type:"finished",content:this.order}}}):setTimeout(this.handleTTSMessageEnd,300)})),c(this,"handleErrorMsg",((e,t)=>{this.sendTTSDataByScene({name:_y,body:{id:this.id,data:{type:"error",content:`TTS SERVER ERROR - ${e} : ${t}`}}})})),c(this,"handleMessage",(e=>{const{data:t}=e;if(P(t)){const e=JSON.parse(t);var n;if("finish"===e.event&&this.handleTTSMessageEnd(),"sentence_start"===e.event)this.currentSentence.text=(null==e||null===(n=e.sentence_start_result)||void 0===n?void 0:n.readable_text)||"";"sentence_end"===e.event&&this.handleCurrentSentenceEnd(),e.message&&this.handleErrorMsg(e.code,e.message)}else this.handleNewBlob(t)})),c(this,"createWS",o((function*(){var e;let t=Jd;const n=Gd(l({speaker:r.speakerId||(null===(e=Va("voiceSpeaker"))||void 0===e?void 0:e.style_id),format:"aac"},Ld()));return r.ws=new WebSocket(`${gy}?${n}`),r.ws.onmessage=r.handleMessage,r.ws.onopen=()=>{t()},new Promise((e=>{t=e}))}))),c(this,"resetTimeoutTimer",(()=>{clearTimeout(this.timeoutTimer),this.timeoutTimer=setTimeout((()=>{this.handleTTSMessageEnd()}),5e3)})),c(this,"addText",function(){var e=o((function*(e){var t;r.ws||(yield r.createWS());const n={event:"text",text:e};null===(t=r.ws)||void 0===t||t.send(JSON.stringify(n)),r.msgSent=!0}));return function(t){return e.apply(this,arguments)}}()),c(this,"sendFinish",(()=>{if(this.msgSent){if(this.ws){const e={event:"finish"};this.ws.send(JSON.stringify(e)),this.ws.onclose=()=>{wy.destroyInstance(this.id)},this.resetTimeoutTimer()}}else setTimeout((()=>{this.sendFinish()}),100)})),c(this,"getId",(()=>this.id)),c(this,"stop",(()=>{this.ws&&(this.handleErrorMsg(-1,"TTS STREAM CLOSED"),this.ws.close(),wy.destroyInstance(this.id))})),this.id=e,this.speakerId=t,this.scene=n}}by=wy,c(wy,"instanceMap",new Map),c(wy,"createNewInstance",((e,t,n)=>{const r=new by(e,t,n);return by.instanceMap.set(r.id,r),r})),c(wy,"getInstance",(e=>by.instanceMap.get(e))),c(wy,"destroyInstance",(e=>by.instanceMap.delete(e)));const ky={name:"start_request_tts_stream",handle:e=>{wy.createNewInstance(e.receiverId,e.speakerId,e.scene)}},Ey={name:"request_stop_tts_stream",handle:e=>{const t=wy.getInstance(e.receiverId);null==t||t.stop()}},Sy={name:"request_tts_stream_with_text",handle:e=>{const t=wy.getInstance(e.receiverId);null==t||t.addText(e.text)}},Ty={name:"finish_request_tts_stream",handle:e=>{const t=wy.getInstance(e.receiverId);null==t||t.sendFinish()}};var Iy=Array.prototype.splice;const xy=function(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;En(i)?Iy.call(e,i,1):bp(e,i)}}return e};const Oy=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=hr(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return xy(e,i),n};const Ny=function(e){return function(t,n,r){var i=Object(t);if(!Le(t)){var o=hr(n,3);t=In(t),n=function(e){return o(i[e],e,i)}}var s=e(t,n,r);return s>-1?i[o?t[s]:s]:void 0}};var Ay=1/0;const Ry=function(e){return e?(e=zp(e))===Ay||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};const Ly=function(e){var t=Ry(e),n=t%1;return t==t?n?t-n:t:0};var Cy=Math.max;const Py=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Ly(n);return i<0&&(i=Cy(r+i,0)),g_(e,hr(t,3),i)};const My=Ny(Py),Dy=[],jy={name:"register_tts_audio",handle:e=>{Boolean(My(Dy,(t=>t.id===e.id)))||Dy.push({id:e.id,scene:e.scene})}},By={name:"stop_all_audios",handle:e=>{Dy.forEach((t=>{t.id!==e.id&&(((e,t)=>{("sidepanel"===t?mo:So)({name:"force_stop_tts_audio",body:{id:e,data:{type:"stop"}}})})(t.id,t.scene),Oy(Dy,(e=>e.id===t.id)))}))}},Fy={name:"tos-get-file-url",handle:function(){var e=o((function*(e){if(!e.length)return{};const t=yield sf({method:"POST",url:`${Ms}/message/get_file_url`,data:{type:"image",uris:e}});return e.reduce(((e,n,r)=>{var i;const{main_url:o,back_url:s}=(null==t||null===(i=t.file_urls)||void 0===i?void 0:i[r])||{},a=o||s||"";return a&&(e[n]=a),e}),{})}));return function(t){return e.apply(this,arguments)}}()};function Uy(){return(Uy=o((function*(e){var t;const n=yield fetch(e,{redirect:"follow"});if(null!==(t=n.headers.get("Content-Type"))&&void 0!==t&&t.includes("text/html")){return yield n.text()}return""}))).apply(this,arguments)}const Gy={name:"get-page-content",handle:function(){var e=o((function*(e){if(e)try{const t=yield function(e){return Uy.apply(this,arguments)}(e.url);return lo("[zx] bg get-page-content",null==e?void 0:e.url,t),{html:t}}catch(t){return e.url,{html:""}}}));return function(t){return e.apply(this,arguments)}}()};const qy=()=>{chrome.runtime.onStartup.addListener(qy),setInterval((()=>{var e,t;null===(e=(t=chrome.runtime).getPlatformInfo)||void 0===e||e.call(t,(()=>{}))}),2e4)},Wy=()=>{chrome.runtime.setUninstallURL(Bd(Oa))},zy=()=>chrome.runtime.setUninstallURL("");let Vy=!1;const Jy=()=>{if(v())fv();else if(!Vy){Vy=!0;try{fv(),dv()}catch(e){fo(e),oc.persist.info({eventName:"background_auto_update",meta:l({},j({message:null==e?void 0:e.message}))})}}},Hy=()=>{var e;Ha().isAuthenticated&&Wy(),nf.addListener("auth-login",Wy),nf.addListener("auth-logout",zy),chrome.runtime.onInstalled.addListener((({reason:e})=>{za("installReason",e),Ip()||Jy();var t;(null===(t=navigator.userAgent)||void 0===t?void 0:t.includes("playwright test framework"))||!0===globalThis.__isE2ETestEnv__||Ip()||(e===chrome.runtime.OnInstalledReason.INSTALL?Tv(1e3).then((()=>{$p.syncFromServer(),$p.startSync()})):e===chrome.runtime.OnInstalledReason.UPDATE&&Tv(1e3).then((()=>{$p.syncToServer(),$p.startSync()}))),e!==chrome.runtime.OnInstalledReason.INSTALL||Ip()||$p.hasSyncedData().then((e=>{e||chrome.tabs.create({url:Bd(xa,{onboarding:"true",skipAuth:"true"},{trackMeta:{previous_page:"landing",login_entrance:"install"}})})}))})),null===(e=chrome.runtime.onUpdateAvailable)||void 0===e||e.addListener((function(e){chrome.runtime.reload()})),qy()},Ky=()=>{Zd.config({userId:Ha().userId||"0",deviceId:Rd()}),Zd.configExtraInfo({country:Ua.launchInfo.country,version:wo(),from:"background"})},$y=function(){var e=o((function*(){try{Hy(),yield qa(),Cp(),No.supportExternal(),Ao(Object.values(r)),Kg(),Zg(),nf.addListener("auth-login",Ky),nf.addListener("auth-login",Cv),nf.addListener("auth-logout",Cv),nf.addListener("auth-logout",Sp),nf.addListener("auth-info-request-updated",Bf),_()&&Vf.startLoopLoginStatus(),yield function(){return qf.apply(this,arguments)}(),Zd.start(),Ky(),function(){Tf.apply(this,arguments)}(),chrome.webRequest.onCompleted.addListener((e=>{var t;null!==(t=e.initiator)&&void 0!==t&&t.startsWith("chrome-extension://")||(lo("[zoei] update_profile detected, updateAuthInfo",e),Bf({reason:"web request: detect profile updated"}))}),{urls:[`*://${Rs}/alice/profile/update_profile*`]}),cv(),yield function(e){return Od.apply(this,arguments)}({resources:ev,isBackground:!0}),rv(),chrome.webNavigation.onDOMContentLoaded.addListener((e=>{0!==e.frameId&&"sub_frame"===e.frameType&&(e.url.startsWith("https://")||e.url.startsWith("http://"))&&chrome.tabs.get(e.tabId,(t=>{const n=new URL(t.url||"");if(/doubao/.test(n.hostname)||/ciciai/.test(n.hostname)){const t={files:["./static/js/subframe_scripts.js"],target:{tabId:e.tabId,frameIds:[e.frameId]}};chrome.scripting.executeScript(t).catch((e=>{oc.persist.error({message:"subframe inject failed",error:e})}))}}))})),chrome.tabs.onUpdated.addListener(Hp(((e,t,n)=>{"complete"===n.status&&Eo({tabId:e,name:"router-change",body:{changeInfo:t}}).catch((e=>{oc.error({error:e})}))}),1e3))}catch(e){fo("init bg error: ",e),oc.persist.info({eventName:"background_init",meta:l({},j({message:null==e?void 0:e.message}))})}}));return function(){return e.apply(this,arguments)}}();try{$y(),Jy()}catch(Xy){lo("background error",Xy)}